(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))))
(if (<= y -7.12267444498305e+45)
(+ x (* y t_1))
(if (<= y 1.6341701951976104e-198)
(fma (* y (- z t)) (/ 1.0 (- a t)) x)
(fma t_1 y x)))))double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (y <= -7.12267444498305e+45) {
tmp = x + (y * t_1);
} else if (y <= 1.6341701951976104e-198) {
tmp = fma((y * (z - t)), (1.0 / (a - t)), x);
} else {
tmp = fma(t_1, y, x);
}
return tmp;
}
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (y <= -7.12267444498305e+45) tmp = Float64(x + Float64(y * t_1)); elseif (y <= 1.6341701951976104e-198) tmp = fma(Float64(y * Float64(z - t)), Float64(1.0 / Float64(a - t)), x); else tmp = fma(t_1, y, x); end return tmp end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.12267444498305e+45], N[(x + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6341701951976104e-198], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(t$95$1 * y + x), $MachinePrecision]]]]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;y \leq -7.12267444498305 \cdot 10^{+45}:\\
\;\;\;\;x + y \cdot t_1\\
\mathbf{elif}\;y \leq 1.6341701951976104 \cdot 10^{-198}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(z - t\right), \frac{1}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_1, y, x\right)\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 1.5 |
|---|---|
| Target | 0.5 |
| Herbie | 0.8 |
if y < -7.12267444498305042e45Initial program 0.6
if -7.12267444498305042e45 < y < 1.6341701951976104e-198Initial program 2.5
Applied egg-rr2.5
Applied egg-rr0.8
if 1.6341701951976104e-198 < y Initial program 0.9
Applied egg-rr0.9
Final simplification0.8
herbie shell --seed 2022153
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))