?

Average Error: 2.2 → 0.5
Time: 17.6s
Precision: binary64
Cost: 13696

?

\[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(\left(-z\right) - 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(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(\left(-z\right) - b\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 2.2

    \[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)} \]

    rational_best_oopsla_all_46_json_45_simplify-74 [=>]0.5

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

    rational_best_oopsla_all_46_json_45_simplify-92 [=>]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(\left(-z\right) - b\right)} \]

Alternatives

Alternative 1
Error6.4
Cost7176
\[\begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+59}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-6}:\\ \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 2
Error8.3
Cost7048
\[\begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+59}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-6}:\\ \;\;\;\;x \cdot e^{b \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 3
Error27.1
Cost6920
\[\begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-292}:\\ \;\;\;\;0 \cdot \left(y \cdot t\right) - \left(y \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 4
Error20.9
Cost6916
\[\begin{array}{l} \mathbf{if}\;y \leq 4.2 \cdot 10^{-41}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 5
Error10.7
Cost6916
\[\begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{-6}:\\ \;\;\;\;x \cdot e^{b \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 6
Error43.3
Cost968
\[\begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+112}:\\ \;\;\;\;-1 \cdot \left(t \cdot \left(y \cdot x\right)\right)\\ \mathbf{elif}\;a \leq 10^{-58}:\\ \;\;\;\;x + x \cdot \left(-a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;0 \cdot \left(y \cdot t\right) - \left(y \cdot t\right) \cdot x\\ \end{array} \]
Alternative 7
Error43.3
Cost776
\[\begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+111}:\\ \;\;\;\;-1 \cdot \left(t \cdot \left(y \cdot x\right)\right)\\ \mathbf{elif}\;a \leq 10^{-58}:\\ \;\;\;\;x + x \cdot \left(-a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\ \end{array} \]
Alternative 8
Error42.1
Cost648
\[\begin{array}{l} t_1 := y \cdot \left(t \cdot \left(-x\right)\right)\\ \mathbf{if}\;a \leq -2.9 \cdot 10^{+137}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 8 \cdot 10^{+105}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error44.2
Cost64
\[x \]

Error

Reproduce?

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