?

Average Error: 1.9 → 0.4
Time: 38.8s
Precision: binary64
Cost: 20544

?

\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
\[x \cdot e^{\left(-a \cdot \left(b + z\right)\right) + \left({z}^{2} \cdot \left(-0.5 \cdot a\right) + \left(\log z - t\right) \cdot y\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
   (+ (- (* a (+ b z))) (+ (* (pow z 2.0) (* -0.5 a)) (* (- (log z) t) y))))))
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((-(a * (b + z)) + ((pow(z, 2.0) * (-0.5 * a)) + ((log(z) - t) * y))));
}
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((-(a * (b + z)) + (((z ** 2.0d0) * ((-0.5d0) * a)) + ((log(z) - t) * y))))
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((-(a * (b + z)) + ((Math.pow(z, 2.0) * (-0.5 * a)) + ((Math.log(z) - t) * y))));
}
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((-(a * (b + z)) + ((math.pow(z, 2.0) * (-0.5 * a)) + ((math.log(z) - t) * y))))
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(a * Float64(b + z))) + Float64(Float64((z ^ 2.0) * Float64(-0.5 * a)) + Float64(Float64(log(z) - t) * y)))))
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((-(a * (b + z)) + (((z ^ 2.0) * (-0.5 * a)) + ((log(z) - t) * y))));
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[(a * N[(b + z), $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[(-0.5 * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $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(-a \cdot \left(b + z\right)\right) + \left({z}^{2} \cdot \left(-0.5 \cdot a\right) + \left(\log z - t\right) \cdot y\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Taylor expanded in z around 0 0.4

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

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

    [Start]0.4

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

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

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

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

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

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

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

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

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

    rational.json-simplify-47 [=>]0.4

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

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

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

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

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

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

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

    rational.json-simplify-47 [=>]0.4

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

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

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

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

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

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

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

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

Alternatives

Alternative 1
Error0.4
Cost20416
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\left(-z\right) + -0.5 \cdot {z}^{2}\right) - b\right)} \]
Alternative 2
Error0.4
Cost13696
\[x \cdot e^{\left(\log z - t\right) \cdot y + \left(-a \cdot \left(b + z\right)\right)} \]
Alternative 3
Error6.6
Cost7176
\[\begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{-13}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-8}:\\ \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 4
Error24.5
Cost7052
\[\begin{array}{l} t_1 := \left(1 + \left(-a \cdot b\right)\right) \cdot \left(-1 - \left(-1 - x\right)\right)\\ \mathbf{if}\;y \leq -2.1 \cdot 10^{-232}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-242}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(b + z\right)\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 5
Error8.1
Cost7048
\[\begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{-13}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-8}:\\ \;\;\;\;x \cdot e^{b \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 6
Error10.7
Cost6916
\[\begin{array}{l} \mathbf{if}\;y \leq 2.05 \cdot 10^{-10}:\\ \;\;\;\;x \cdot e^{b \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;{z}^{y} \cdot x\\ \end{array} \]
Alternative 7
Error33.4
Cost1164
\[\begin{array}{l} t_1 := \left(1 + \left(-a \cdot b\right)\right) \cdot \left(-1 - \left(-1 - x\right)\right)\\ \mathbf{if}\;y \leq -9.5 \cdot 10^{-230}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-241}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(b + z\right)\right)\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(0 - \left(-1 - a \cdot \left(b \cdot \left(-x\right)\right)\right)\right) - 1\\ \end{array} \]
Alternative 8
Error34.8
Cost1032
\[\begin{array}{l} t_1 := \left(1 + \left(-a \cdot b\right)\right) \cdot \left(-1 - \left(-1 - x\right)\right)\\ \mathbf{if}\;y \leq -5 \cdot 10^{-231}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-244}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(b + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error39.3
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-31}:\\ \;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \leq 0.122:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(b + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot \left(-x\right)\right)\\ \end{array} \]
Alternative 10
Error39.4
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-31}:\\ \;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \leq 0.122:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot \left(-x\right)\right)\\ \end{array} \]
Alternative 11
Error39.2
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-28}:\\ \;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \leq 3450:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot \left(-x\right)\right)\\ \end{array} \]
Alternative 12
Error40.1
Cost516
\[\begin{array}{l} \mathbf{if}\;y \leq 3400:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot \left(-x\right)\right)\\ \end{array} \]
Alternative 13
Error43.6
Cost64
\[x \]

Error

Reproduce?

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