Average Error: 7.4 → 0.1
Time: 18.4s
Precision: binary64
Cost: 13696
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
\[\left(\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - t\right) + \log y \cdot \left(-1 + x\right) \]
(FPCore (x y z t)
 :precision binary64
 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
(FPCore (x y z t)
 :precision binary64
 (+ (- (* (log1p (- y)) (+ z -1.0)) t) (* (log y) (+ -1.0 x))))
double code(double x, double y, double z, double t) {
	return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
double code(double x, double y, double z, double t) {
	return ((log1p(-y) * (z + -1.0)) - t) + (log(y) * (-1.0 + x));
}
public static double code(double x, double y, double z, double t) {
	return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
public static double code(double x, double y, double z, double t) {
	return ((Math.log1p(-y) * (z + -1.0)) - t) + (Math.log(y) * (-1.0 + x));
}
def code(x, y, z, t):
	return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
def code(x, y, z, t):
	return ((math.log1p(-y) * (z + -1.0)) - t) + (math.log(y) * (-1.0 + x))
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t)
end
function code(x, y, z, t)
	return Float64(Float64(Float64(log1p(Float64(-y)) * Float64(z + -1.0)) - t) + Float64(log(y) * Float64(-1.0 + x)))
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - t\right) + \log y \cdot \left(-1 + x\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 7.4

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

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

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

Alternatives

Alternative 1
Error0.4
Cost7616
\[\left(\log y \cdot \left(-1 + x\right) + \left(y \cdot \left(y \cdot -0.5\right) - y\right) \cdot \left(z + -1\right)\right) - t \]
Alternative 2
Error2.8
Cost7497
\[\begin{array}{l} \mathbf{if}\;-1 + x \leq -400000 \lor \neg \left(-1 + x \leq -1\right):\\ \;\;\;\;\log y \cdot \left(-1 + x\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y - y \cdot z\right) - \log y\right) - t\\ \end{array} \]
Alternative 3
Error6.7
Cost7241
\[\begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+183} \lor \neg \left(z \leq 1.3 \cdot 10^{+233}\right):\\ \;\;\;\;y \cdot \left(1 - z\right) + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot \left(-1 + x\right) - t\\ \end{array} \]
Alternative 4
Error6.7
Cost7241
\[\begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+183} \lor \neg \left(z \leq 1.22 \cdot 10^{+231}\right):\\ \;\;\;\;y \cdot \left(1 - z\right) + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(y + \log y \cdot \left(-1 + x\right)\right) - t\\ \end{array} \]
Alternative 5
Error1.1
Cost7241
\[\begin{array}{l} \mathbf{if}\;x \leq -1700 \lor \neg \left(x \leq 0.28\right):\\ \;\;\;\;x \cdot \log y - \left(t + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y - y \cdot z\right) - \log y\right) - t\\ \end{array} \]
Alternative 6
Error0.6
Cost7232
\[\left(\log y \cdot \left(-1 + x\right) + y \cdot \left(1 - z\right)\right) - t \]
Alternative 7
Error0.6
Cost7232
\[\log y \cdot \left(-1 + x\right) + \left(y \cdot \left(1 - z\right) - t\right) \]
Alternative 8
Error9.7
Cost7113
\[\begin{array}{l} \mathbf{if}\;y \leq 2.65 \cdot 10^{-89} \lor \neg \left(y \leq 4.6 \cdot 10^{-62}\right):\\ \;\;\;\;\log y \cdot \left(-1 + x\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(y - y \cdot z\right) - t\\ \end{array} \]
Alternative 9
Error14.4
Cost7049
\[\begin{array}{l} \mathbf{if}\;x \leq -7900 \lor \neg \left(x \leq 6.6\right):\\ \;\;\;\;x \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(-y\right) \cdot z - t\\ \end{array} \]
Alternative 10
Error14.5
Cost6985
\[\begin{array}{l} \mathbf{if}\;x \leq -22500 \lor \neg \left(x \leq 9.5\right):\\ \;\;\;\;x \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;\left(y - y \cdot z\right) - t\\ \end{array} \]
Alternative 11
Error21.2
Cost6857
\[\begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+69} \lor \neg \left(x \leq 1.6 \cdot 10^{+93}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(y - y \cdot z\right) - t\\ \end{array} \]
Alternative 12
Error36.0
Cost584
\[\begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+40}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-8}:\\ \;\;\;\;y - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 13
Error36.2
Cost520
\[\begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+40}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+20}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 14
Error33.4
Cost448
\[\left(y - y \cdot z\right) - t \]
Alternative 15
Error33.6
Cost384
\[-\left(t + y \cdot z\right) \]
Alternative 16
Error40.7
Cost128
\[-t \]

Error

Reproduce

herbie shell --seed 2022343 
(FPCore (x y z t)
  :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
  :precision binary64
  (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))