(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
↓
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -2e-235) (not (<= t_1 0.0)))
(+ x (- y (/ y (/ (- a t) (- z t)))))
(- x (/ y (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
↓
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -2e-235) || !(t_1 <= 0.0)) {
tmp = x + (y - (y / ((a - t) / (z - t))));
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
↓
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x + y) + ((y * (t - z)) / (a - t))
if ((t_1 <= (-2d-235)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = x + (y - (y / ((a - t) / (z - t))))
else
tmp = x - (y / (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
↓
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -2e-235) || !(t_1 <= 0.0)) {
tmp = x + (y - (y / ((a - t) / (z - t))));
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a):
return (x + y) - (((z - t) * y) / (a - t))
↓
def code(x, y, z, t, a):
t_1 = (x + y) + ((y * (t - z)) / (a - t))
tmp = 0
if (t_1 <= -2e-235) or not (t_1 <= 0.0):
tmp = x + (y - (y / ((a - t) / (z - t))))
else:
tmp = x - (y / (t / (a - z)))
return tmp
function code(x, y, z, t, a)
return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t)))
end
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.9999999999999999e-235 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))
(+.f64 x (-.f64 y (/.f64 y (/.f64 (-.f64 a t) (-.f64 z t))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (Rewrite<= +-rgt-identity_binary64 (+.f64 y 0)) (/.f64 y (/.f64 (-.f64 a t) (-.f64 z t))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (+.f64 y 0) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (+.f64 y 0) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 z t) y)) (-.f64 a t)))): 4 points increase in error, 0 points decrease in error
(Rewrite=> associate-+r-_binary64 (-.f64 (+.f64 x (+.f64 y 0)) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))): 0 points increase in error, 4 points decrease in error
(-.f64 (+.f64 x (Rewrite=> +-rgt-identity_binary64 y)) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))): 0 points increase in error, 0 points decrease in error
if -1.9999999999999999e-235 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0
(+.f64 x (-.f64 y (/.f64 y (/.f64 (-.f64 a t) (-.f64 z t))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (Rewrite<= +-rgt-identity_binary64 (+.f64 y 0)) (/.f64 y (/.f64 (-.f64 a t) (-.f64 z t))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (+.f64 y 0) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (-.f64 (+.f64 y 0) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 z t) y)) (-.f64 a t)))): 4 points increase in error, 0 points decrease in error
(Rewrite=> associate-+r-_binary64 (-.f64 (+.f64 x (+.f64 y 0)) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))): 0 points increase in error, 4 points decrease in error
(-.f64 (+.f64 x (Rewrite=> +-rgt-identity_binary64 y)) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))): 0 points increase in error, 0 points decrease in error
\[\leadsto x + \color{blue}{\frac{\left(-y\right) \cdot \left(a - z\right)}{t}}
\]
Proof
(+.f64 x (/.f64 (*.f64 (neg.f64 y) (-.f64 a z)) t)): 0 points increase in error, 0 points decrease in error
(+.f64 x (/.f64 (*.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 y)) (-.f64 a z)) t)): 6 points increase in error, 0 points decrease in error
(+.f64 x (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -1 (*.f64 y (-.f64 a z)))) t)): 0 points increase in error, 6 points decrease in error
(+.f64 x (/.f64 (*.f64 -1 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y a) (*.f64 y z)))) t)): 0 points increase in error, 6 points decrease in error
(+.f64 x (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (*.f64 y a)) (*.f64 -1 (*.f64 y z)))) t)): 6 points increase in error, 0 points decrease in error
(+.f64 x (/.f64 (-.f64 (*.f64 -1 (Rewrite=> *-commutative_binary64 (*.f64 a y))) (*.f64 -1 (*.f64 y z))) t)): 0 points increase in error, 0 points decrease in error
(-.f64 x (/.f64 y (/.f64 t (-.f64 a z)))): 0 points increase in error, 0 points decrease in error
(-.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 a z)) t))): 8 points increase in error, 0 points decrease in error
(-.f64 x (Rewrite<= associate-*r/_binary64 (*.f64 y (/.f64 (-.f64 a z) t)))): 0 points increase in error, 3 points decrease in error
(-.f64 x (Rewrite<= *-lft-identity_binary64 (*.f64 1 (*.f64 y (/.f64 (-.f64 a z) t))))): 0 points increase in error, 8 points decrease in error
(Rewrite=> cancel-sign-sub-inv_binary64 (+.f64 x (*.f64 (neg.f64 1) (*.f64 y (/.f64 (-.f64 a z) t))))): 8 points increase in error, 0 points decrease in error
(+.f64 x (*.f64 (Rewrite=> metadata-eval -1) (*.f64 y (/.f64 (-.f64 a z) t)))): 0 points increase in error, 0 points decrease in error
(+.f64 x (*.f64 -1 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y (-.f64 a z)) t)))): 0 points increase in error, 8 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y (-.f64 a z)) t)) x)): 0 points increase in error, 0 points decrease in error
herbie shell --seed 2022343
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))