Math FPCore C Julia Wolfram TeX \[x + \frac{y \cdot \left(z - x\right)}{t}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.01 \cdot 10^{-143}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - x}{t}, x\right)\\
\end{array}
\]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t))) ↓
(FPCore (x y z t)
:precision binary64
(if (<= t -4.01e-143)
(+ x (* (/ y t) (- z x)))
(if (<= t 1.2e-10) (+ x (/ (* y (- z x)) t)) (fma y (/ (- z x) t) x)))) double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
↓
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.01e-143) {
tmp = x + ((y / t) * (z - x));
} else if (t <= 1.2e-10) {
tmp = x + ((y * (z - x)) / t);
} else {
tmp = fma(y, ((z - x) / t), x);
}
return tmp;
}
function code(x, y, z, t)
return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
↓
function code(x, y, z, t)
tmp = 0.0
if (t <= -4.01e-143)
tmp = Float64(x + Float64(Float64(y / t) * Float64(z - x)));
elseif (t <= 1.2e-10)
tmp = Float64(x + Float64(Float64(y * Float64(z - x)) / t));
else
tmp = fma(y, Float64(Float64(z - x) / t), x);
end
return tmp
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := If[LessEqual[t, -4.01e-143], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-10], N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]]]
x + \frac{y \cdot \left(z - x\right)}{t}
↓
\begin{array}{l}
\mathbf{if}\;t \leq -4.01 \cdot 10^{-143}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - x}{t}, x\right)\\
\end{array}
Alternatives Alternative 1 Error 23.01% Cost 1108
\[\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
t_2 := \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+203}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{-243}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{+291}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\end{array}
\]
Alternative 2 Error 40.46% Cost 1044
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-104}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-30}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+17}:\\
\;\;\;\;\frac{-y}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 3 Error 40.44% Cost 1044
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-30}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-10}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+17}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 4 Error 3.71% Cost 841
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-183} \lor \neg \left(t \leq 5.8 \cdot 10^{-296}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\
\end{array}
\]
Alternative 5 Error 4.08% Cost 841
\[\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+25} \lor \neg \left(z \leq -6.2 \cdot 10^{-286}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\end{array}
\]
Alternative 6 Error 2.23% Cost 841
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.01 \cdot 10^{-143} \lor \neg \left(t \leq 6 \cdot 10^{+18}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\end{array}
\]
Alternative 7 Error 2.31% Cost 840
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.01 \cdot 10^{-143}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{elif}\;t \leq 1.96 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - x}{\frac{t}{y}}\\
\end{array}
\]
Alternative 8 Error 35.26% Cost 713
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-44} \lor \neg \left(y \leq 2.3 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 9 Error 16.18% Cost 713
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-33} \lor \neg \left(x \leq 2.4 \cdot 10^{-14}\right):\\
\;\;\;\;x - x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\]
Alternative 10 Error 16.17% Cost 712
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-33}:\\
\;\;\;\;x - \frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-14}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{t}\\
\end{array}
\]
Alternative 11 Error 45.47% Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{-42} \lor \neg \left(y \leq 2.8 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 12 Error 39.87% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-108}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 13 Error 49.73% Cost 64
\[x
\]