(FPCore (x y z t)
:precision binary64
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- y (/ t y))))
(if (<= y -1.75e-96)
(+ x (/ -0.3333333333333333 (/ z t_1)))
(if (<= y 3e-137)
(+ x (/ (/ t z) (* y 3.0)))
(+ x (* t_1 (/ -0.3333333333333333 z)))))))
double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -1.75e-96) {
tmp = x + (-0.3333333333333333 / (z / t_1));
} else if (y <= 3e-137) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x + (t_1 * (-0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
↓
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y - (t / y)
if (y <= (-1.75d-96)) then
tmp = x + ((-0.3333333333333333d0) / (z / t_1))
else if (y <= 3d-137) then
tmp = x + ((t / z) / (y * 3.0d0))
else
tmp = x + (t_1 * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -1.75e-96) {
tmp = x + (-0.3333333333333333 / (z / t_1));
} else if (y <= 3e-137) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x + (t_1 * (-0.3333333333333333 / z));
}
return tmp;
}
(+.f64 x (*.f64 (/.f64 -1/3 z) (-.f64 y (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (*.f64 (/.f64 (Rewrite<= metadata-eval (/.f64 -1 3)) z) (-.f64 y (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (*.f64 (Rewrite<= associate-/r*_binary64 (/.f64 -1 (*.f64 3 z))) (-.f64 y (/.f64 t y)))): 23 points increase in error, 17 points decrease in error
(+.f64 x (*.f64 (/.f64 -1 (Rewrite<= *-commutative_binary64 (*.f64 z 3))) (-.f64 y (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 (/.f64 -1 (*.f64 z 3)) y) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y))))): 0 points increase in error, 3 points decrease in error
(+.f64 x (-.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 -1 y) (*.f64 z 3))) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y)))): 2 points increase in error, 19 points decrease in error
(+.f64 x (-.f64 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 y)) (*.f64 z 3)) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 y (*.f64 z 3)))) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -1 t) (*.f64 (*.f64 z 3) y))))): 14 points increase in error, 31 points decrease in error
(+.f64 x (-.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 t)) (*.f64 (*.f64 z 3) y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 t (*.f64 (*.f64 z 3) y)))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= unsub-neg_binary64 (+.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (neg.f64 (neg.f64 (/.f64 t (*.f64 (*.f64 z 3) y))))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (/.f64 y (*.f64 z 3)) (neg.f64 (/.f64 t (*.f64 (*.f64 z 3) y))))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 (/.f64 y (*.f64 z 3)) (/.f64 t (*.f64 (*.f64 z 3) y)))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= sub-neg_binary64 (-.f64 x (-.f64 (/.f64 y (*.f64 z 3)) (/.f64 t (*.f64 (*.f64 z 3) y))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y)))): 0 points increase in error, 0 points decrease in error
Applied egg-rr0.8
\[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y - \frac{t}{y}}}}
\]
if -1.7499999999999999e-96 < y < 2.9999999999999998e-137
(+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 (/.f64 t z) (*.f64 y 3))): 0 points increase in error, 0 points decrease in error
(+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 (/.f64 t z) (Rewrite<= *-commutative_binary64 (*.f64 3 y)))): 0 points increase in error, 0 points decrease in error
(+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (Rewrite<= associate-/r*_binary64 (/.f64 t (*.f64 z (*.f64 3 y))))): 12 points increase in error, 11 points decrease in error
(+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 z 3) y)))): 9 points increase in error, 7 points decrease in error
(+.f64 x (*.f64 (/.f64 -1/3 z) (-.f64 y (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (*.f64 (/.f64 (Rewrite<= metadata-eval (/.f64 -1 3)) z) (-.f64 y (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (*.f64 (Rewrite<= associate-/r*_binary64 (/.f64 -1 (*.f64 3 z))) (-.f64 y (/.f64 t y)))): 23 points increase in error, 17 points decrease in error
(+.f64 x (*.f64 (/.f64 -1 (Rewrite<= *-commutative_binary64 (*.f64 z 3))) (-.f64 y (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 (/.f64 -1 (*.f64 z 3)) y) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y))))): 0 points increase in error, 3 points decrease in error
(+.f64 x (-.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 -1 y) (*.f64 z 3))) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y)))): 2 points increase in error, 19 points decrease in error
(+.f64 x (-.f64 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 y)) (*.f64 z 3)) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 y (*.f64 z 3)))) (*.f64 (/.f64 -1 (*.f64 z 3)) (/.f64 t y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -1 t) (*.f64 (*.f64 z 3) y))))): 14 points increase in error, 31 points decrease in error
(+.f64 x (-.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 t)) (*.f64 (*.f64 z 3) y)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 t (*.f64 (*.f64 z 3) y)))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= unsub-neg_binary64 (+.f64 (neg.f64 (/.f64 y (*.f64 z 3))) (neg.f64 (neg.f64 (/.f64 t (*.f64 (*.f64 z 3) y))))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (/.f64 y (*.f64 z 3)) (neg.f64 (/.f64 t (*.f64 (*.f64 z 3) y))))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 (/.f64 y (*.f64 z 3)) (/.f64 t (*.f64 (*.f64 z 3) y)))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= sub-neg_binary64 (-.f64 x (-.f64 (/.f64 y (*.f64 z 3)) (/.f64 t (*.f64 (*.f64 z 3) y))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y)))): 0 points increase in error, 0 points decrease in error
herbie shell --seed 2022325
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))