(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 (* y (/ (- z t) (- a t)))))
(if (<= t_1 -2e+23)
(fma (/ y (- a t)) (- z t) x)
(if (<= t_1 1e-263)
(+ x (/ (* y (- z t)) (- a t)))
(+ x (/ y (/ (- a t) (- z t))))))))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 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= -2e+23) {
tmp = fma((y / (a - t)), (z - t), x);
} else if (t_1 <= 1e-263) {
tmp = x + ((y * (z - t)) / (a - t));
} else {
tmp = x + (y / ((a - t) / (z - t)));
}
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(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e+23) tmp = fma(Float64(y / Float64(a - t)), Float64(z - t), x); elseif (t_1 <= 1e-263) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); 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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+23], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 1e-263], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{elif}\;t_1 \leq 10^{-263}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 1.4 |
|---|---|
| Target | 0.4 |
| Herbie | 1.1 |
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < -1.9999999999999998e23Initial program 2.8
Taylor expanded in y around 0 26.1
Simplified2.5
Applied egg-rr2.5
if -1.9999999999999998e23 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 1e-263Initial program 0.5
Taylor expanded in y around 0 0.2
if 1e-263 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 1.5
Taylor expanded in y around 0 12.0
Simplified1.3
Final simplification1.1
herbie shell --seed 2022166
(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)))))