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 0.8 Cost 33860
\[\begin{array}{l}
t_1 := a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \left(\log z - t\right)\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-10}:\\
\;\;\;\;x \cdot e^{t_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\]
Alternative 2 Error 1.7 Cost 13636
\[\begin{array}{l}
\mathbf{if}\;a \leq 1.2 \cdot 10^{+143}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\]
Alternative 3 Error 2.6 Cost 7436
\[\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right) - a \cdot b}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{-127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-238}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{elif}\;y \leq 1.45:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 4 Error 24.1 Cost 7316
\[\begin{array}{l}
t_1 := \left(1 + x \cdot \left(1 - z \cdot a\right)\right) + -1\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;\left(1 + a \cdot \left(x \cdot b\right)\right) + -1\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-274}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-278}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 5 Error 6.5 Cost 7176
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{-24}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 0.112:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 6 Error 10.5 Cost 7048
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{+178}:\\
\;\;\;\;\left(1 + a \cdot \left(x \cdot b\right)\right) + -1\\
\mathbf{elif}\;y \leq 0.64:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 7 Error 8.7 Cost 7048
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-95}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 0.175:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 8 Error 33.7 Cost 1496
\[\begin{array}{l}
t_1 := \left(1 + a \cdot \left(x \cdot b\right)\right) + -1\\
t_2 := \left(1 + x \cdot \left(1 - z \cdot a\right)\right) + -1\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-274}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-278}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-127}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+91}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+205}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 9 Error 33.9 Cost 1104
\[\begin{array}{l}
t_1 := \left(1 + a \cdot \left(x \cdot b\right)\right) + -1\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-285}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-277}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-19}:\\
\;\;\;\;x - y \cdot \left(x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 10 Error 37.1 Cost 976
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-287}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-277}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-24}:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
Alternative 11 Error 37.4 Cost 976
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-285}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-277}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-23}:\\
\;\;\;\;x - y \cdot \left(x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
Alternative 12 Error 36.6 Cost 912
\[\begin{array}{l}
t_1 := a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-287}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-275}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 13 Error 36.8 Cost 912
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-287}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-276}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
Alternative 14 Error 36.8 Cost 912
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-287}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-277}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\]
Alternative 15 Error 35.3 Cost 648
\[\begin{array}{l}
t_1 := a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.46 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 16 Error 40.4 Cost 452
\[\begin{array}{l}
\mathbf{if}\;y \leq 10500000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\]
Alternative 17 Error 44.2 Cost 64
\[x
\]