Average Error: 2.1 → 0.4
Time: 11.7s
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)}\]
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)));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error4.7
Cost7554
\[\begin{array}{l} \mathbf{if}\;y \leq -497610064691.84064:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq 3.5079553932183625 \cdot 10^{-62}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 2
Error6.2
Cost7426
\[\begin{array}{l} \mathbf{if}\;y \leq -443.62559036853503:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq 3.5079553932183625 \cdot 10^{-62}:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 3
Error17.4
Cost1622
\[\begin{array}{l} \mathbf{if}\;y \leq -9.833092599104121 \cdot 10^{-113}:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq -3.150568392075559 \cdot 10^{-206} \lor \neg \left(y \leq -8.939281722446197 \cdot 10^{-277}\right) \land \left(y \leq -1.355154033426289 \cdot 10^{-308} \lor \neg \left(y \leq 2.9152902654397555 \cdot 10^{-282}\right) \land y \leq 1.5749333415452295 \cdot 10^{-92}\right):\\ \;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 4
Error17.4
Cost1990
\[\begin{array}{l} \mathbf{if}\;y \leq -5.438156796420675 \cdot 10^{-113}:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq -1.242976983642734 \cdot 10^{-206}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -8.939281722446197 \cdot 10^{-277}:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq -2.971923734863674 \cdot 10^{-309}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.9746432292435246 \cdot 10^{-279}:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq 2.7402460128311343 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 5
Error18.5
Cost64
\[0\]
Alternative 6
Error61.9
Cost64
\[1\]

Error

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 around 0 0.5

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

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

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

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

Reproduce

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