?

Average Error: 2.2 → 0.5
Time: 25.8s
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^{\left(\log z - t\right) \cdot y + \left(-a\right) \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 (+ (* (- (log z) t) y) (* (- 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((((log(z) - t) * y) + (-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((((log(z) - t) * y) + (-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((((Math.log(z) - t) * y) + (-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((((math.log(z) - t) * y) + (-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(Float64(log(z) - t) * y) + Float64(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((((log(z) - t) * y) + (-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[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $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^{\left(\log z - t\right) \cdot y + \left(-a\right) \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.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^{\color{blue}{-1 \cdot \left(a \cdot z\right) + \left(y \cdot \left(\log z - t\right) + -1 \cdot \left(a \cdot b\right)\right)}} \]
  3. Simplified0.5

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

    [Start]0.5

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

    rational.json-simplify-41 [=>]0.5

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

    rational.json-simplify-2 [<=]0.5

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

    rational.json-simplify-43 [=>]0.5

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

    rational.json-simplify-43 [=>]0.5

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

    rational.json-simplify-2 [=>]0.5

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

    rational.json-simplify-43 [=>]0.5

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

    rational.json-simplify-43 [=>]0.5

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

    rational.json-simplify-51 [=>]0.5

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

    rational.json-simplify-2 [=>]0.5

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

    rational.json-simplify-9 [=>]0.5

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

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

Alternatives

Alternative 1
Error0.8
Cost13700
\[\begin{array}{l} \mathbf{if}\;y \leq 5 \cdot 10^{-57}:\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y + \left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(\log z - t\right) \cdot y + b \cdot \left(-a\right)}\\ \end{array} \]
Alternative 2
Error1.2
Cost13380
\[\begin{array}{l} \mathbf{if}\;y \leq 1.95 \cdot 10^{-13}:\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y + \left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(\log z - t\right) \cdot y}\\ \end{array} \]
Alternative 3
Error0.9
Cost13252
\[\begin{array}{l} \mathbf{if}\;y \leq 9 \cdot 10^{-13}:\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y + \left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\log z \cdot y}\\ \end{array} \]
Alternative 4
Error14.6
Cost7568
\[\begin{array}{l} t_1 := \frac{x}{e^{y \cdot t + a \cdot z}}\\ \mathbf{if}\;t \leq -6.1 \cdot 10^{+196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -7.8 \cdot 10^{+77}:\\ \;\;\;\;-1 + \left(1 - \frac{-x}{e^{b \cdot a}}\right)\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{+58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{e^{a \cdot \left(z + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-\left(a \cdot z + y \cdot t\right)}\\ \end{array} \]
Alternative 5
Error13.6
Cost7304
\[\begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{x}{e^{y \cdot t + a \cdot z}}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+40}:\\ \;\;\;\;\frac{x}{e^{a \cdot \left(z + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-\left(a \cdot z + y \cdot t\right)}\\ \end{array} \]
Alternative 6
Error29.7
Cost7248
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ t_2 := a \cdot b + 1\\ \mathbf{if}\;a \leq -1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{1}{\frac{t_2}{x}}\\ \mathbf{elif}\;a \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-150}:\\ \;\;\;\;\frac{x}{t_2}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+128}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{a \cdot z}}\\ \end{array} \]
Alternative 7
Error22.0
Cost7248
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ t_2 := \frac{x}{e^{b \cdot a}}\\ \mathbf{if}\;x \leq -3.15 \cdot 10^{-40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{-192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-236}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-68}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error13.5
Cost7240
\[\begin{array}{l} t_1 := \frac{x}{e^{y \cdot t + a \cdot z}}\\ \mathbf{if}\;t \leq -1.5 \cdot 10^{+58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+30}:\\ \;\;\;\;\frac{x}{e^{a \cdot \left(z + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error7.2
Cost7232
\[x \cdot e^{\left(-t\right) \cdot y + \left(-a\right) \cdot \left(z + b\right)} \]
Alternative 10
Error15.1
Cost7112
\[\begin{array}{l} t_1 := \frac{x}{e^{y \cdot t}}\\ \mathbf{if}\;t \leq -8.4 \cdot 10^{+83}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 9.4 \cdot 10^{+163}:\\ \;\;\;\;\frac{x}{e^{a \cdot \left(z + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error17.3
Cost6984
\[\begin{array}{l} t_1 := \frac{x}{e^{y \cdot t}}\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{+108}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+163}:\\ \;\;\;\;\frac{x}{e^{b \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error30.4
Cost1100
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ t_2 := \frac{x}{a \cdot b + 1}\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{-37}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-191}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-235}:\\ \;\;\;\;\frac{1}{\frac{1}{x} + b \cdot \frac{a}{x}}\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error30.9
Cost976
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ t_2 := \frac{x}{a \cdot b + 1}\\ \mathbf{if}\;x \leq -3.7 \cdot 10^{-34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-236}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error30.8
Cost976
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ t_2 := a \cdot b + 1\\ t_3 := \frac{x}{t_2}\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{-35}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-191}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-236}:\\ \;\;\;\;\frac{1}{\frac{t_2}{x}}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 15
Error39.6
Cost848
\[\begin{array}{l} t_1 := \frac{x}{a \cdot b}\\ \mathbf{if}\;b \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-155}:\\ \;\;\;\;\left(b \cdot x\right) \cdot \left(-a\right)\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{+71}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error32.8
Cost844
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ \mathbf{if}\;a \leq -3.1 \cdot 10^{+107}:\\ \;\;\;\;\frac{x}{a \cdot b}\\ \mathbf{elif}\;a \leq -1.4 \cdot 10^{-189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-151}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error32.9
Cost780
\[\begin{array}{l} t_1 := -1 + \left(1 - \left(-x\right)\right)\\ \mathbf{if}\;a \leq -2.2 \cdot 10^{+106}:\\ \;\;\;\;\frac{x}{a \cdot b}\\ \mathbf{elif}\;a \leq -5.2 \cdot 10^{-186}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-151}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error39.3
Cost584
\[\begin{array}{l} t_1 := \frac{x}{a \cdot b}\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{+70}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 19
Error38.5
Cost584
\[\begin{array}{l} \mathbf{if}\;a \leq -6.4:\\ \;\;\;\;\frac{x}{a \cdot b}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{+122}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a}}{b}\\ \end{array} \]
Alternative 20
Error45.4
Cost64
\[x \]

Error

Reproduce?

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