Average Error: 9.6 → 0.2
Time: 8.4s
Precision: binary64
Cost: 13696
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t \]
\[\left(z \cdot \left(0.3333333333333333 \cdot \left(3 \cdot \mathsf{log1p}\left(-y\right)\right)\right) + x \cdot \log y\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
 (- (+ (* z (* 0.3333333333333333 (* 3.0 (log1p (- y))))) (* x (log y))) 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 ((z * (0.3333333333333333 * (3.0 * log1p(-y)))) + (x * log(y))) - t;
}
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 ((z * (0.3333333333333333 * (3.0 * Math.log1p(-y)))) + (x * Math.log(y))) - 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 ((z * (0.3333333333333333 * (3.0 * math.log1p(-y)))) + (x * math.log(y))) - 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(z * Float64(0.3333333333333333 * Float64(3.0 * log1p(Float64(-y))))) + Float64(x * log(y))) - 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[(z * N[(0.3333333333333333 * N[(3.0 * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(z \cdot \left(0.3333333333333333 \cdot \left(3 \cdot \mathsf{log1p}\left(-y\right)\right)\right) + x \cdot \log y\right) - t

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.6
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.6

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t \]
  2. Applied egg-rr0.2

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(3 \cdot \mathsf{log1p}\left(-y\right)\right)\right)}\right) - t \]
  3. Final simplification0.2

    \[\leadsto \left(z \cdot \left(0.3333333333333333 \cdot \left(3 \cdot \mathsf{log1p}\left(-y\right)\right)\right) + x \cdot \log y\right) - t \]

Alternatives

Alternative 1
Error6.3
Cost7112
\[\begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t_1 - t\\ \mathbf{if}\;t \leq -2.008210813311964 \cdot 10^{-75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 3.850130319430743 \cdot 10^{-86}:\\ \;\;\;\;t_1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error7.4
Cost6984
\[\begin{array}{l} t_1 := x \cdot \log y - t\\ \mathbf{if}\;x \leq -7.432213117427062 \cdot 10^{-136}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.060342914185974 \cdot 10^{-205}:\\ \;\;\;\;y \cdot \left(-z\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error13.9
Cost6856
\[\begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -6.267401684283695 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.1310013792096254 \cdot 10^{+62}:\\ \;\;\;\;\left(y \cdot z\right) \cdot \left(-1 + y \cdot -0.5\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error27.0
Cost704
\[\left(y \cdot z\right) \cdot \left(-1 + y \cdot -0.5\right) - t \]
Alternative 5
Error32.7
Cost520
\[\begin{array}{l} \mathbf{if}\;t \leq -9.503827415252146 \cdot 10^{-76}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 3.850130319430743 \cdot 10^{-86}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 6
Error27.2
Cost384
\[y \cdot \left(-z\right) - t \]
Alternative 7
Error36.6
Cost128
\[-t \]

Error

Reproduce

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