?

Average Error: 1.9 → 0.3
Time: 1.7min
Precision: binary64
Cost: 65472

?

\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
\[\begin{array}{l} t_1 := \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a\right)}}\\ \left(x \cdot t_1\right) \cdot t_1 \end{array} \]
(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
 (let* ((t_1 (sqrt (exp (fma y (- (log z) t) (* (- (log1p (- z)) b) a))))))
   (* (* x t_1) t_1)))
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) {
	double t_1 = sqrt(exp(fma(y, (log(z) - t), ((log1p(-z) - b) * a))));
	return (x * t_1) * t_1;
}
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)
	t_1 = sqrt(exp(fma(y, Float64(log(z) - t), Float64(Float64(log1p(Float64(-z)) - b) * a))))
	return Float64(Float64(x * t_1) * t_1)
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_] := Block[{t$95$1 = N[Sqrt[N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[(x * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision]]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\begin{array}{l}
t_1 := \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a\right)}}\\
\left(x \cdot t_1\right) \cdot t_1
\end{array}

Error?

Derivation?

  1. Initial program 1.9

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Applied egg-rr0.3

    \[\leadsto \color{blue}{\left(x \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a\right)}}\right) \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a\right)}}} \]

Alternatives

Alternative 1
Error0.3
Cost26368
\[x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{log1p}\left(-z\right) - b\right) \cdot a\right)} \]
Alternative 2
Error1.9
Cost20160
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
Alternative 3
Error7.1
Cost7440
\[\begin{array}{l} t_1 := x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ t_2 := x \cdot e^{-y \cdot t}\\ \mathbf{if}\;y \leq -7.4 \cdot 10^{+140}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{-75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 4
Error9.2
Cost7248
\[\begin{array}{l} t_1 := \frac{x}{e^{a \cdot b}}\\ t_2 := x \cdot e^{-y \cdot t}\\ \mathbf{if}\;y \leq -1.08 \cdot 10^{+139}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -8.6 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-110}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 5
Error10.9
Cost6852
\[\begin{array}{l} \mathbf{if}\;y \leq 0.00041:\\ \;\;\;\;\frac{x}{e^{a \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 6
Error19.0
Cost6788
\[\begin{array}{l} \mathbf{if}\;y \leq 1.9 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{a \cdot b + 1}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 7
Error33.3
Cost844
\[\begin{array}{l} t_1 := \frac{x}{a \cdot b + 1}\\ \mathbf{if}\;y \leq 2900:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+149}:\\ \;\;\;\;\left(-x \cdot b\right) \cdot a\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+173}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-b\right) \cdot a\right) \cdot x\\ \end{array} \]
Alternative 8
Error40.6
Cost648
\[\begin{array}{l} t_1 := \left(-x \cdot b\right) \cdot a\\ \mathbf{if}\;y \leq -3.4 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error40.9
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+138}:\\ \;\;\;\;\left(\left(-b\right) \cdot a\right) \cdot x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot b\right) \cdot a\\ \end{array} \]
Alternative 10
Error40.2
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{-11}:\\ \;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot b\right) \cdot a\\ \end{array} \]
Alternative 11
Error44.6
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023033 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  :precision binary64
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))