(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
↓
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.4e+104)
(+ t (* (- y a) (/ (- x t) z)))
(if (<= z 4.38e+20)
(+ x (* (- t x) (/ (- y z) (- a z))))
(+ t (* (- t x) (/ (- a y) z))))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
↓
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+104) {
tmp = t + ((y - a) * ((x - t) / z));
} else if (z <= 4.38e+20) {
tmp = x + ((t - x) * ((y - z) / (a - z)));
} else {
tmp = t + ((t - x) * ((a - y) / 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 - x)) / (a - z))
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) :: tmp
if (z <= (-4.4d+104)) then
tmp = t + ((y - a) * ((x - t) / z))
else if (z <= 4.38d+20) then
tmp = x + ((t - x) * ((y - z) / (a - z)))
else
tmp = t + ((t - x) * ((a - y) / 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 - x)) / (a - z));
}
↓
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+104) {
tmp = t + ((y - a) * ((x - t) / z));
} else if (z <= 4.38e+20) {
tmp = x + ((t - x) * ((y - z) / (a - z)));
} else {
tmp = t + ((t - x) * ((a - y) / z));
}
return tmp;
}
def code(x, y, z, t, a):
return x + (((y - z) * (t - x)) / (a - z))
↓
def code(x, y, z, t, a):
tmp = 0
if z <= -4.4e+104:
tmp = t + ((y - a) * ((x - t) / z))
elif z <= 4.38e+20:
tmp = x + ((t - x) * ((y - z) / (a - z)))
else:
tmp = t + ((t - x) * ((a - y) / z))
return tmp
function code(x, y, z, t, a)
return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z)))
end
↓
function code(x, y, z, t, a)
tmp = 0.0
if (z <= -4.4e+104)
tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)));
elseif (z <= 4.38e+20)
tmp = Float64(x + Float64(Float64(t - x) * Float64(Float64(y - z) / Float64(a - z))));
else
tmp = Float64(t + Float64(Float64(t - x) * Float64(Float64(a - y) / z)));
end
return tmp
end
function tmp = code(x, y, z, t, a)
tmp = x + (((y - z) * (t - x)) / (a - z));
end
↓
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.4e+104)
tmp = t + ((y - a) * ((x - t) / z));
elseif (z <= 4.38e+20)
tmp = x + ((t - x) * ((y - z) / (a - z)));
else
tmp = t + ((t - x) * ((a - y) / z));
end
tmp_2 = tmp;
end
(fma.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x) x): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x)) x)): 0 points increase in error, 4 points decrease in error
(+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) x): 0 points increase in error, 0 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))): 4 points increase in error, 0 points decrease in error
(-.f64 t (*.f64 (/.f64 (-.f64 t x) z) (-.f64 y a))): 0 points increase in error, 0 points decrease in error
(-.f64 t (Rewrite<= associate-/r/_binary64 (/.f64 (-.f64 t x) (/.f64 z (-.f64 y a))))): 0 points increase in error, 0 points decrease in error
(-.f64 t (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 t x) (-.f64 y a)) z))): 10 points increase in error, 0 points decrease in error
(-.f64 t (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 y a) (-.f64 t x))) z)): 0 points increase in error, 2 points decrease in error
(Rewrite<= unsub-neg_binary64 (+.f64 t (neg.f64 (/.f64 (*.f64 (-.f64 y a) (-.f64 t x)) z)))): 2 points increase in error, 0 points decrease in error
(+.f64 t (Rewrite=> distribute-neg-frac_binary64 (/.f64 (neg.f64 (*.f64 (-.f64 y a) (-.f64 t x))) z))): 0 points increase in error, 0 points decrease in error
(+.f64 t (/.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 (-.f64 y a) (-.f64 t x)))) z)): 0 points increase in error, 0 points decrease in error
(+.f64 t (/.f64 (Rewrite=> associate-*r*_binary64 (*.f64 (*.f64 -1 (-.f64 y a)) (-.f64 t x))) z)): 0 points increase in error, 10 points decrease in error
(+.f64 t (/.f64 (*.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 y) (*.f64 -1 a))) (-.f64 t x)) z)): 10 points increase in error, 0 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 y) (*.f64 -1 a)) (-.f64 t x)) z) t)): 0 points increase in error, 2 points decrease in error
(fma.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x) x): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x)) x)): 0 points increase in error, 4 points decrease in error
(+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) x): 0 points increase in error, 0 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))): 4 points increase in error, 0 points decrease in error
(fma.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x) x): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x)) x)): 0 points increase in error, 4 points decrease in error
(+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) x): 0 points increase in error, 0 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))): 4 points increase in error, 0 points decrease in error
(-.f64 t (*.f64 (/.f64 (-.f64 t x) z) (-.f64 y a))): 0 points increase in error, 0 points decrease in error
(-.f64 t (Rewrite<= associate-/r/_binary64 (/.f64 (-.f64 t x) (/.f64 z (-.f64 y a))))): 0 points increase in error, 0 points decrease in error
(-.f64 t (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 t x) (-.f64 y a)) z))): 10 points increase in error, 0 points decrease in error
(-.f64 t (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 y a) (-.f64 t x))) z)): 0 points increase in error, 2 points decrease in error
(Rewrite<= unsub-neg_binary64 (+.f64 t (neg.f64 (/.f64 (*.f64 (-.f64 y a) (-.f64 t x)) z)))): 2 points increase in error, 0 points decrease in error
(+.f64 t (Rewrite=> distribute-neg-frac_binary64 (/.f64 (neg.f64 (*.f64 (-.f64 y a) (-.f64 t x))) z))): 0 points increase in error, 0 points decrease in error
(+.f64 t (/.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 (-.f64 y a) (-.f64 t x)))) z)): 0 points increase in error, 0 points decrease in error
(+.f64 t (/.f64 (Rewrite=> associate-*r*_binary64 (*.f64 (*.f64 -1 (-.f64 y a)) (-.f64 t x))) z)): 0 points increase in error, 10 points decrease in error
(+.f64 t (/.f64 (*.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 y) (*.f64 -1 a))) (-.f64 t x)) z)): 10 points increase in error, 0 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 y) (*.f64 -1 a)) (-.f64 t x)) z) t)): 0 points increase in error, 2 points decrease in error
herbie shell --seed 2022343
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))
(+ x (/ (* (- y z) (- t x)) (- a z))))