(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 (- INFINITY))
(fma (/ (- y z) (- a z)) t x)
(if (<= t_1 3.318126047084e+283)
(+ t_1 x)
(fma (- y z) (/ t (- a z)) x)))))double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(((y - z) / (a - z)), t, x);
} else if (t_1 <= 3.318126047084e+283) {
tmp = t_1 + x;
} else {
tmp = fma((y - z), (t / (a - z)), x);
}
return tmp;
}
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x); elseif (t_1 <= 3.318126047084e+283) tmp = Float64(t_1 + x); else tmp = fma(Float64(y - z), Float64(t / Float64(a - z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[t$95$1, 3.318126047084e+283], N[(t$95$1 + x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{elif}\;t_1 \leq 3.318126047084 \cdot 10^{+283}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a - z}, 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 | 10.4 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0Initial program 64.0
Simplified0.2
Taylor expanded in y around 0 64.0
Simplified0.1
Applied egg-rr0.1
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 3.3181260470839999e283Initial program 0.2
if 3.3181260470839999e283 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 60.7
Simplified1.4
Applied egg-rr1.5
Applied egg-rr1.4
Final simplification0.3
herbie shell --seed 2022150
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))