Branch Coverage

blib/lib/Math/Polynom.pm
Criterion Covered Total %
branch 167 190 87.8


line true false branch
48 0 414 if $DEBUG
59 13 121 if (exists $$self{'polynom'}{$power}) { }
76 16 472 if ($coef == 0)
108 10 0 if (defined $args)
136 1 154 if scalar(@args) % 2
140 1 482 unless looks_like_number $n
192 2 1639 if scalar @_ != 2
193 1 1638 unless defined $x
194 4 1634 unless looks_like_number $x
201 1630 4 unless (float_is_nan $r)
202 37 1593 if (not defined $self->xpos and $r > 0) { }
18 2953 elsif (not defined $self->xneg and $r < 0) { }
220 2 25 if scalar @_ != 2
221 1 24 unless defined $p
224 20 4 if (ref $p eq 'Math::Polynom')
233 1 3 unless looks_like_number $p
246 2 13 if scalar @_ != 2
247 1 12 unless defined $p
249 8 4 if (ref $p eq 'Math::Polynom')
253 1 3 unless looks_like_number $p
276 2 20 if scalar @_ != 2
277 1 19 unless defined $p
279 18 1 if (ref $p eq 'Math::Polynom')
289 1 0 unless looks_like_number $p
302 1 7 if scalar @_ != 2
303 1 6 unless defined $x
304 2 4 unless looks_like_number $x
305 1 3 if $x == 0
324 14 5 if exists $hash{'guess'}
325 9 10 if exists $hash{'precision'}
326 1 18 if exists $hash{'max_depth'}
328 1 18 unless defined $new_guess
329 1 17 unless defined $precision
330 0 17 unless defined $max_depth
331 1 16 unless looks_like_number $new_guess
332 1 15 unless looks_like_number $precision
333 0 15 unless $max_depth =~ /^\d+$/
336 1 14 if scalar keys %{$$self{'polynom'};} == 0
345 0 126 if $dividend == 0
351 1 125 if $self->iterations > $max_depth
354 1 124 if float_is_nan $new_guess
358 0 12 unless ($self->_is_root($new_guess))
379 7 16 if exists $hash{'precision'}
380 1 22 if exists $hash{'max_depth'}
381 21 2 if exists $hash{'p0'}
382 21 2 if exists $hash{'p1'}
384 1 22 unless defined $precision
385 0 22 unless defined $max_depth
386 1 21 unless looks_like_number $precision
387 0 21 unless $max_depth =~ /^\d+$/
388 1 20 unless defined $p0
389 1 19 unless defined $p1
390 1 18 unless looks_like_number $p0
391 1 17 unless looks_like_number $p1
392 1 16 if $p0 == $p1
395 1 15 if scalar keys %{$$self{'polynom'};} == 0
403 0 15 if float_is_nan $q0 or float_is_nan $q1
406 0 15 if $q0 == 0
407 1 14 if $q1 == 0
413 0 119 if $q1 - $q0 == 0
418 0 119 if float_is_nan $p
427 1 118 if float_is_nan $q1
432 12 106 if ($q1 == 0 or abs $p - $p1 <= $precision)
433 0 12 unless ($self->_is_root($p))
461 8 24 if exists $hash{'precision'}
462 2 30 if exists $hash{'max_depth'}
463 30 2 if exists $hash{'a'}
464 30 2 if exists $hash{'b'}
466 1 31 unless defined $precision
467 0 31 unless defined $max_depth
468 1 30 unless looks_like_number $precision
469 0 30 unless $max_depth =~ /^\d+$/
470 1 29 unless defined $a
471 1 28 unless defined $b
472 1 27 unless looks_like_number $a
473 1 26 unless looks_like_number $b
474 1 25 if $a == $b
477 1 24 if scalar keys %{$$self{'polynom'};} == 0
487 0 24 if float_is_nan $f_a or float_is_nan $f_b
491 1 23 if $f_a == 0
492 2 21 if $f_b == 0
496 2 19 if $f_a * $f_b > 0
500 14 5 if (abs $f_a < abs $f_b)
514 1 296 if $self->iterations > $max_depth
518 277 19 if ($self->iterations != 0)
523 0 277 if float_is_nan $f_a
524 0 277 if float_is_nan $f_b
525 0 277 if float_is_nan $f_c
531 0 296 if ($f_a == $f_b) { }
51 245 elsif ($f_a != $f_c and $f_b != $f_c) { }
546 225 71 if ($s < (3 * $a + $b) / 4 and $s > $b or $mflag and abs $s - $b >= abs($b - $c) / 2 or not $mflag and abs $s - $b >= abs($c - $d) / 2) { }
559 0 296 if float_is_nan $f_s
567 62 234 if ($f_a * $f_s <= 0) { }
578 73 223 if (abs $f_a < abs $f_b)
587 0 18 unless ($self->_is_root($b))