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 Accuracy 95.5% Cost 27460
\[\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right)\\
\mathbf{if}\;t_1 + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2 \cdot 10^{+39}:\\
\;\;\;\;x \cdot e^{-1 + \left(t_1 + \left(1 - a \cdot b\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\]
Alternative 2 Accuracy 89.8% Cost 7176
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{+89}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 1.6:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 3 Accuracy 86.8% Cost 7048
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+89}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 1.15:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 4 Accuracy 56.2% Cost 6921
\[\begin{array}{l}
\mathbf{if}\;b \leq 1.45 \cdot 10^{+191} \lor \neg \left(b \leq 4.8 \cdot 10^{+278}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 5 Accuracy 83.4% Cost 6916
\[\begin{array}{l}
\mathbf{if}\;y \leq 0.185:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\]
Alternative 6 Accuracy 29.3% Cost 976
\[\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{+116}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;b \leq -4.4 \cdot 10^{-303}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-122}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+112}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 7 Accuracy 29.2% Cost 976
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.36 \cdot 10^{+116}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;b \leq -2.7 \cdot 10^{-302}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{-123}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+112}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 8 Accuracy 29.3% Cost 976
\[\begin{array}{l}
t_1 := x \cdot \left(y \cdot t\right)\\
\mathbf{if}\;b \leq -3.9 \cdot 10^{+117}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;b \leq -4.8 \cdot 10^{-302}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.26 \cdot 10^{-123}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+110}:\\
\;\;\;\;x - t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 9 Accuracy 29.4% Cost 848
\[\begin{array}{l}
t_1 := x \cdot \left(y \cdot t\right)\\
\mathbf{if}\;b \leq -3.9 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.7 \cdot 10^{-301}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{-122}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 10 Accuracy 29.5% Cost 848
\[\begin{array}{l}
\mathbf{if}\;b \leq -4.7 \cdot 10^{+115}:\\
\;\;\;\;y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;b \leq -2.75 \cdot 10^{-300}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{-123}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 11 Accuracy 29.5% Cost 848
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{+116}:\\
\;\;\;\;y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;b \leq -4.6 \cdot 10^{-301}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.35 \cdot 10^{-123}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 12 Accuracy 29.5% Cost 848
\[\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+117}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;b \leq -1.7 \cdot 10^{-299}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{-123}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 13 Accuracy 35.3% Cost 452
\[\begin{array}{l}
\mathbf{if}\;y \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\]
Alternative 14 Accuracy 30.1% Cost 64
\[x
\]