(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 (- INFINITY))
x
(if (<= t_1 1.710510294576776e+291) (/ (- (* y x) (* z x)) (- t z)) x))))double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x;
} else if (t_1 <= 1.710510294576776e+291) {
tmp = ((y * x) - (z * x)) / (t - z);
} else {
tmp = x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x;
} else if (t_1 <= 1.710510294576776e+291) {
tmp = ((y * x) - (z * x)) / (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) tmp = 0 if t_1 <= -math.inf: tmp = x elif t_1 <= 1.710510294576776e+291: tmp = ((y * x) - (z * x)) / (t - z) else: tmp = x return tmp
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = x; elseif (t_1 <= 1.710510294576776e+291) tmp = Float64(Float64(Float64(y * x) - Float64(z * x)) / Float64(t - z)); else tmp = x; end return tmp end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x; elseif (t_1 <= 1.710510294576776e+291) tmp = ((y * x) - (z * x)) / (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], x, If[LessEqual[t$95$1, 1.710510294576776e+291], N[(N[(N[(y * x), $MachinePrecision] - N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], x]]]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x\\
\mathbf{elif}\;t_1 \leq 1.710510294576776 \cdot 10^{+291}:\\
\;\;\;\;\frac{y \cdot x - z \cdot x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 12.0 |
|---|---|
| Target | 2.0 |
| Herbie | 5.9 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or 1.710510294576776e291 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 63.3
Taylor expanded in z around inf 27.2
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.710510294576776e291Initial program 1.5
Taylor expanded in y around 0 1.5
Final simplification5.9
herbie shell --seed 2022152
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))