?

Average Error: 9.5 → 0.2
Time: 20.4s
Precision: binary64
Cost: 27200

?

\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t \]
\[\left(x \cdot \log y + z \cdot \left(-0.3333333333333333 \cdot {y}^{3} + \left(\left(\left(-y\right) + -0.5 \cdot {y}^{2}\right) + -0.25 \cdot {y}^{4}\right)\right)\right) - t \]
(FPCore (x y z t)
 :precision binary64
 (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
(FPCore (x y z t)
 :precision binary64
 (-
  (+
   (* x (log y))
   (*
    z
    (+
     (* -0.3333333333333333 (pow y 3.0))
     (+ (+ (- y) (* -0.5 (pow y 2.0))) (* -0.25 (pow y 4.0))))))
  t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * ((-0.3333333333333333 * pow(y, 3.0)) + ((-y + (-0.5 * pow(y, 2.0))) + (-0.25 * pow(y, 4.0)))))) - t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * log(y)) + (z * log((1.0d0 - y)))) - t
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * log(y)) + (z * (((-0.3333333333333333d0) * (y ** 3.0d0)) + ((-y + ((-0.5d0) * (y ** 2.0d0))) + ((-0.25d0) * (y ** 4.0d0)))))) - t
end function
public static double code(double x, double y, double z, double t) {
	return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
public static double code(double x, double y, double z, double t) {
	return ((x * Math.log(y)) + (z * ((-0.3333333333333333 * Math.pow(y, 3.0)) + ((-y + (-0.5 * Math.pow(y, 2.0))) + (-0.25 * Math.pow(y, 4.0)))))) - t;
}
def code(x, y, z, t):
	return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
def code(x, y, z, t):
	return ((x * math.log(y)) + (z * ((-0.3333333333333333 * math.pow(y, 3.0)) + ((-y + (-0.5 * math.pow(y, 2.0))) + (-0.25 * math.pow(y, 4.0)))))) - t
function code(x, y, z, t)
	return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t)
end
function code(x, y, z, t)
	return Float64(Float64(Float64(x * log(y)) + Float64(z * Float64(Float64(-0.3333333333333333 * (y ^ 3.0)) + Float64(Float64(Float64(-y) + Float64(-0.5 * (y ^ 2.0))) + Float64(-0.25 * (y ^ 4.0)))))) - t)
end
function tmp = code(x, y, z, t)
	tmp = ((x * log(y)) + (z * log((1.0 - y)))) - t;
end
function tmp = code(x, y, z, t)
	tmp = ((x * log(y)) + (z * ((-0.3333333333333333 * (y ^ 3.0)) + ((-y + (-0.5 * (y ^ 2.0))) + (-0.25 * (y ^ 4.0)))))) - t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(-0.3333333333333333 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[((-y) + N[(-0.5 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.25 * N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(x \cdot \log y + z \cdot \left(-0.3333333333333333 \cdot {y}^{3} + \left(\left(\left(-y\right) + -0.5 \cdot {y}^{2}\right) + -0.25 \cdot {y}^{4}\right)\right)\right) - t

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.5
Target0.3
Herbie0.2
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right) \]

Derivation?

  1. Initial program 9.5

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t \]
  2. Taylor expanded in y around 0 0.2

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

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(-0.3333333333333333 \cdot {y}^{3} + \left(\left(\left(-y\right) + -0.5 \cdot {y}^{2}\right) + -0.25 \cdot {y}^{4}\right)\right)}\right) - t \]
    Proof

    [Start]0.2

    \[ \left(x \cdot \log y + z \cdot \left(-0.5 \cdot {y}^{2} + \left(-0.25 \cdot {y}^{4} + \left(-0.3333333333333333 \cdot {y}^{3} + -1 \cdot y\right)\right)\right)\right) - t \]

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

    \[ \left(x \cdot \log y + z \cdot \color{blue}{\left(-0.25 \cdot {y}^{4} + \left(\left(-0.3333333333333333 \cdot {y}^{3} + -1 \cdot y\right) + -0.5 \cdot {y}^{2}\right)\right)}\right) - t \]

    rational.json-simplify-1 [<=]0.2

    \[ \left(x \cdot \log y + z \cdot \left(-0.25 \cdot {y}^{4} + \color{blue}{\left(-0.5 \cdot {y}^{2} + \left(-0.3333333333333333 \cdot {y}^{3} + -1 \cdot y\right)\right)}\right)\right) - t \]

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

    \[ \left(x \cdot \log y + z \cdot \left(-0.25 \cdot {y}^{4} + \color{blue}{\left(-0.3333333333333333 \cdot {y}^{3} + \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)\right)}\right)\right) - t \]

    rational.json-simplify-1 [<=]0.2

    \[ \left(x \cdot \log y + z \cdot \left(-0.25 \cdot {y}^{4} + \left(-0.3333333333333333 \cdot {y}^{3} + \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)}\right)\right)\right) - t \]

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

    \[ \left(x \cdot \log y + z \cdot \color{blue}{\left(-0.3333333333333333 \cdot {y}^{3} + \left(\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right) + -0.25 \cdot {y}^{4}\right)\right)}\right) - t \]

    rational.json-simplify-1 [=>]0.2

    \[ \left(x \cdot \log y + z \cdot \left(-0.3333333333333333 \cdot {y}^{3} + \left(\color{blue}{\left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + -0.25 \cdot {y}^{4}\right)\right)\right) - t \]

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

    \[ \left(x \cdot \log y + z \cdot \left(-0.3333333333333333 \cdot {y}^{3} + \left(\left(\color{blue}{y \cdot -1} + -0.5 \cdot {y}^{2}\right) + -0.25 \cdot {y}^{4}\right)\right)\right) - t \]

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

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

    \[\leadsto \left(x \cdot \log y + z \cdot \left(-0.3333333333333333 \cdot {y}^{3} + \left(\left(\left(-y\right) + -0.5 \cdot {y}^{2}\right) + -0.25 \cdot {y}^{4}\right)\right)\right) - t \]

Alternatives

Alternative 1
Error0.3
Cost20480
\[\left(x \cdot \log y + z \cdot \left(-0.5 \cdot {y}^{2} + \left(\left(-y\right) + -0.3333333333333333 \cdot {y}^{3}\right)\right)\right) - t \]
Alternative 2
Error0.3
Cost13888
\[\left(\log y \cdot x + \left(z \cdot \left(-y\right) + -0.5 \cdot \left({y}^{2} \cdot z\right)\right)\right) - t \]
Alternative 3
Error0.3
Cost13760
\[\left(x \cdot \log y + z \cdot \left(\left(-y\right) + -0.5 \cdot {y}^{2}\right)\right) - t \]
Alternative 4
Error6.3
Cost7044
\[\begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{-88}:\\ \;\;\;\;\log \left(\frac{1}{y}\right) \cdot \left(-x\right) - t\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-104}:\\ \;\;\;\;y \cdot \left(-z\right) - t\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x - t\\ \end{array} \]
Alternative 5
Error0.5
Cost7040
\[\left(\log y \cdot x + z \cdot \left(-y\right)\right) - t \]
Alternative 6
Error6.3
Cost6984
\[\begin{array}{l} t_1 := \log y \cdot x - t\\ \mathbf{if}\;x \leq -8.6 \cdot 10^{-88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-z\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error13.6
Cost6856
\[\begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -1.95 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+43}:\\ \;\;\;\;y \cdot \left(-z\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error34.4
Cost520
\[\begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{+65}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-37}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 9
Error27.4
Cost384
\[y \cdot \left(-z\right) - t \]
Alternative 10
Error36.7
Cost128
\[-t \]

Error

Reproduce?

herbie shell --seed 2023077 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))

  (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))