(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 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y)))))
(if (<= (* z 3.0) -4e-37)
t_1
(if (<= (* z 3.0) 10.0) (+ x (* (/ 1.0 z) (/ (- y (/ t y)) -3.0))) t_1))))
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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
if ((z * 3.0d0) <= (-4d-37)) then
tmp = t_1
else if ((z * 3.0d0) <= 10.0d0) then
tmp = x + ((1.0d0 / z) * ((y - (t / y)) / (-3.0d0)))
else
tmp = t_1
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));
}
(+.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)))): 24 points increase in error, 23 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, 1 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)))): 11 points increase in error, 18 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))))): 25 points increase in error, 19 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.3
\[\leadsto x + \color{blue}{\frac{y - \frac{t}{y}}{z \cdot -3}}
\]
Applied egg-rr0.3
\[\leadsto x + \color{blue}{\frac{1}{z} \cdot \frac{y - \frac{t}{y}}{-3}}
\]
herbie shell --seed 2022330
(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))))