Average Error: 2.1 → 0.5
Time: 22.2s
Precision: binary64
Cost: 13632
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
\[x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\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 (- (* y (- (log z) t)) (* a (+ 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(((y * (log(z) - t)) - (a * (z + b))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) - (a * (z + b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) - (a * (z + b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) - (a * (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(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) - (a * (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[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(z + 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^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 2.1

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Taylor expanded in z around 0 0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{-1 \cdot z} - b\right)} \]
  3. Simplified0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(-z\right)} - b\right)} \]
    Proof

    [Start]0.5

    \[ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(-1 \cdot z - b\right)} \]

    mul-1-neg [=>]0.5

    \[ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(-z\right)} - b\right)} \]
  4. Final simplification0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)} \]

Alternatives

Alternative 1
Error7.1
Cost13768
\[\begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+130}:\\ \;\;\;\;x \cdot e^{-y \cdot t}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+98}:\\ \;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(y \cdot \left(\log z - t\right) + 1\right) + -1}\\ \end{array} \]
Alternative 2
Error7.1
Cost13640
\[\begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{+130}:\\ \;\;\;\;x \cdot e^{-y \cdot t}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+96}:\\ \;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \end{array} \]
Alternative 3
Error8.0
Cost13576
\[\begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{-5}:\\ \;\;\;\;e^{-y \cdot t}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-12}:\\ \;\;\;\;x \cdot \frac{{z}^{y}}{e^{a \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]
Alternative 4
Error10.5
Cost13512
\[\begin{array}{l} \mathbf{if}\;a \leq -2.25 \cdot 10^{+48}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{+165}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{z \cdot \left(-a\right)}\\ \end{array} \]
Alternative 5
Error2.4
Cost13504
\[x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b} \]
Alternative 6
Error8.4
Cost7048
\[\begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{+91}:\\ \;\;\;\;e^{-y \cdot t}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-12}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]
Alternative 7
Error29.8
Cost6921
\[\begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-6} \lor \neg \left(y \leq 3.2 \cdot 10^{-78}\right):\\ \;\;\;\;e^{-y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \]
Alternative 8
Error20.2
Cost6921
\[\begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{+130} \lor \neg \left(t \leq 1.28 \cdot 10^{+151}\right):\\ \;\;\;\;e^{-y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]
Alternative 9
Error40.5
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 1.32 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot b\right)\\ \end{array} \]
Alternative 10
Error44.1
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2023016 
(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))))))