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 1.5 Cost 20292
\[\begin{array}{l}
\mathbf{if}\;a \leq 3.8 \cdot 10^{+117}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\]
Alternative 2 Error 1.6 Cost 13636
\[\begin{array}{l}
\mathbf{if}\;a \leq 3.05 \cdot 10^{+119}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\]
Alternative 3 Error 2.8 Cost 7372
\[\begin{array}{l}
t_1 := \frac{x}{e^{y \cdot t + a \cdot b}}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{-118}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-185}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 4 Error 25.0 Cost 7316
\[\begin{array}{l}
t_1 := \left(1 + x \cdot \left(1 - z \cdot a\right)\right) + -1\\
t_2 := a \cdot \left(x \cdot b\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{-8}:\\
\;\;\;\;\left(1 + t_2\right) + -1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-217}:\\
\;\;\;\;\frac{x \cdot x}{x + t_2}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-149}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 5 Error 7.2 Cost 7176
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{e^{y \cdot t}}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-36}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 6 Error 9.1 Cost 7116
\[\begin{array}{l}
t_1 := \frac{x}{e^{y \cdot t}}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 7 Error 11.8 Cost 6984
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+30}:\\
\;\;\;\;\left(1 + a \cdot \left(x \cdot b\right)\right) + -1\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 8 Error 33.7 Cost 1236
\[\begin{array}{l}
t_1 := \left(1 + a \cdot \left(x \cdot b\right)\right) + -1\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-9}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+70}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 9 Error 34.6 Cost 1104
\[\begin{array}{l}
t_1 := a \cdot \left(x \cdot b\right)\\
t_2 := \left(1 + t_1\right) + -1\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-218}:\\
\;\;\;\;\frac{x \cdot x}{x + t_1}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-228}:\\
\;\;\;\;\left(1 + x \cdot \left(1 - z \cdot a\right)\right) + -1\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-74}:\\
\;\;\;\;x - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 10 Error 34.3 Cost 972
\[\begin{array}{l}
t_1 := a \cdot \left(x \cdot b\right)\\
t_2 := \left(1 + t_1\right) + -1\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-228}:\\
\;\;\;\;\left(1 + x \cdot \left(1 - z \cdot a\right)\right) + -1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-74}:\\
\;\;\;\;x - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 11 Error 35.7 Cost 712
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-55}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-12}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\]
Alternative 12 Error 35.5 Cost 648
\[\begin{array}{l}
t_1 := a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.00016:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 13 Error 35.8 Cost 648
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-55}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\]
Alternative 14 Error 39.6 Cost 584
\[\begin{array}{l}
t_1 := a \cdot \left(x \cdot b\right)\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 64000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 15 Error 39.0 Cost 584
\[\begin{array}{l}
t_1 := \frac{x \cdot x}{x}\\
\mathbf{if}\;y \leq -3.65 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-128}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 16 Error 44.5 Cost 64
\[x
\]