(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 (- INFINITY))
(fma (- z t) (/ y (- a t)) x)
(if (<= t_1 7.699020357290224e+278)
(+ t_1 x)
(fma y (/ 1.0 (- (/ a (- z t)) (/ t (- z t)))) 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 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((z - t), (y / (a - t)), x);
} else if (t_1 <= 7.699020357290224e+278) {
tmp = t_1 + x;
} else {
tmp = fma(y, (1.0 / ((a / (z - t)) - (t / (z - t)))), x);
}
return tmp;
}
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(z - t), Float64(y / Float64(a - t)), x); elseif (t_1 <= 7.699020357290224e+278) tmp = Float64(t_1 + x); else tmp = fma(y, Float64(1.0 / Float64(Float64(a / Float64(z - t)) - Float64(t / Float64(z - t)))), x); end return tmp end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 7.699020357290224e+278], N[(t$95$1 + x), $MachinePrecision], N[(y * N[(1.0 / N[(N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision] - N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a - t}, x\right)\\
\mathbf{elif}\;t_1 \leq 7.699020357290224 \cdot 10^{+278}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{1}{\frac{a}{z - t} - \frac{t}{z - t}}, 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.5 |
|---|---|
| Target | 1.3 |
| Herbie | 0.3 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 64.0
Simplified0.1
Taylor expanded in y around 0 64.0
Simplified0.1
Taylor expanded in x around 0 64.0
Simplified0.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 7.699020357290224e278Initial program 0.3
Simplified1.6
Taylor expanded in y around 0 0.3
Simplified3.5
Applied *-un-lft-identity_binary643.5
Applied associate-*l*_binary643.5
Simplified0.3
if 7.699020357290224e278 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 59.3
Simplified1.1
Applied clear-num_binary641.1
Taylor expanded in a around 0 1.1
Final simplification0.3
herbie shell --seed 2022131
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))