Math FPCore C Julia Wolfram TeX \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\]
↓
\[x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\]
(FPCore (x y z t a b)
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))) ↓
(FPCore (x y z t a b)
:precision binary64
(* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b)))))) double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
↓
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b)
return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
↓
function code(x, y, z, t, a, b)
return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b)))))
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
↓
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
Alternatives Alternative 1 Error 10.0 Cost 13708
\[\begin{array}{l}
t_1 := e^{a \cdot b}\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{+151}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-162}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{+114}:\\
\;\;\;\;x \cdot \frac{{z}^{y}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\end{array}
\]
Alternative 2 Error 8.5 Cost 13708
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{-53}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-162}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \frac{{z}^{y}}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\end{array}
\]
Alternative 3 Error 1.6 Cost 13636
\[\begin{array}{l}
\mathbf{if}\;a \leq 1.12 \cdot 10^{+122}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\end{array}
\]
Alternative 4 Error 7.0 Cost 13576
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{elif}\;y \leq 0.68:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 5 Error 8.6 Cost 13380
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 6 Error 22.2 Cost 7316
\[\begin{array}{l}
t_1 := x - t \cdot \left(x \cdot y\right)\\
t_2 := \left(x + 1\right) + -1\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{-206}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-254}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-223}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-40}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 7 Error 22.2 Cost 7316
\[\begin{array}{l}
t_1 := \left(x + 1\right) + -1\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{-145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-255}:\\
\;\;\;\;x \cdot e^{a \cdot b}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{-89}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 8 Error 8.4 Cost 6984
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 0.0105:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 9 Error 10.9 Cost 6852
\[\begin{array}{l}
\mathbf{if}\;y \leq 3.25 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 10 Error 31.6 Cost 1753
\[\begin{array}{l}
t_1 := x - t \cdot \left(x \cdot y\right)\\
t_2 := \left(x + 1\right) + -1\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-206}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-40} \lor \neg \left(y \leq 3.4 \cdot 10^{-13}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \left(a \cdot b\right) \cdot \left(-1 + \left(a \cdot b\right) \cdot 0.5\right)\right)\\
\end{array}
\]
Alternative 11 Error 31.5 Cost 1753
\[\begin{array}{l}
t_1 := x - t \cdot \left(x \cdot y\right)\\
t_2 := \left(x + 1\right) + -1\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{-206}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-40} \lor \neg \left(y \leq 7 \cdot 10^{-13}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(\left(a \cdot b\right) \cdot \left(-1 + \left(a \cdot b\right) \cdot 0.5\right)\right)\\
\end{array}
\]
Alternative 12 Error 31.4 Cost 978
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-201} \lor \neg \left(y \leq 7.2 \cdot 10^{-255} \lor \neg \left(y \leq 1.75 \cdot 10^{-221}\right) \land y \leq 6.6 \cdot 10^{-88}\right):\\
\;\;\;\;\left(x + 1\right) + -1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\]
Alternative 13 Error 31.4 Cost 978
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-206} \lor \neg \left(y \leq 1.65 \cdot 10^{-259}\right) \land \left(y \leq 2.85 \cdot 10^{-221} \lor \neg \left(y \leq 2.5 \cdot 10^{-87}\right)\right):\\
\;\;\;\;\left(x + 1\right) + -1\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\end{array}
\]
Alternative 14 Error 31.4 Cost 850
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-198} \lor \neg \left(y \leq 2.8 \cdot 10^{-257}\right) \land \left(y \leq 1.5 \cdot 10^{-222} \lor \neg \left(y \leq 7.5 \cdot 10^{-93}\right)\right):\\
\;\;\;\;\left(x + 1\right) + -1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 15 Error 44.4 Cost 64
\[x
\]