?

Average Error: 6.7 → 0.3
Time: 19.4s
Precision: binary64
Cost: 20736

?

\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(-y\right) + \left(-0.5 \cdot {y}^{2} + -0.3333333333333333 \cdot {y}^{3}\right)\right)\right) - t \]
(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
 (-
  (+
   (* (- x 1.0) (log y))
   (*
    (- z 1.0)
    (+ (- y) (+ (* -0.5 (pow y 2.0)) (* -0.3333333333333333 (pow y 3.0))))))
  t))
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 (((x - 1.0) * log(y)) + ((z - 1.0) * (-y + ((-0.5 * pow(y, 2.0)) + (-0.3333333333333333 * pow(y, 3.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 - 1.0d0) * log(y)) + ((z - 1.0d0) * 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * (-y + (((-0.5d0) * (y ** 2.0d0)) + ((-0.3333333333333333d0) * (y ** 3.0d0)))))) - t
end function
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 (((x - 1.0) * Math.log(y)) + ((z - 1.0) * (-y + ((-0.5 * Math.pow(y, 2.0)) + (-0.3333333333333333 * Math.pow(y, 3.0)))))) - t;
}
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 (((x - 1.0) * math.log(y)) + ((z - 1.0) * (-y + ((-0.5 * math.pow(y, 2.0)) + (-0.3333333333333333 * math.pow(y, 3.0)))))) - t
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(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * Float64(Float64(-y) + Float64(Float64(-0.5 * (y ^ 2.0)) + Float64(-0.3333333333333333 * (y ^ 3.0)))))) - t)
end
function tmp = code(x, y, z, t)
	tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
end
function tmp = code(x, y, z, t)
	tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * (-y + ((-0.5 * (y ^ 2.0)) + (-0.3333333333333333 * (y ^ 3.0)))))) - t;
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[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[((-y) + N[(N[(-0.5 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(-y\right) + \left(-0.5 \cdot {y}^{2} + -0.3333333333333333 \cdot {y}^{3}\right)\right)\right) - t

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 6.7

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

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

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

    [Start]0.3

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

    rational.json-simplify-41 [<=]0.3

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

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

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

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

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

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

Alternatives

Alternative 1
Error0.4
Cost14016
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(-y\right) + -0.5 \cdot {y}^{2}\right)\right) - t \]
Alternative 2
Error2.6
Cost7560
\[\begin{array}{l} t_1 := \left(x - 1\right) \cdot \log y - t\\ \mathbf{if}\;x - 1 \leq -20:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x - 1 \leq -1:\\ \;\;\;\;\left(y \cdot \left(1 - z\right) + \left(-\log y\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error27.8
Cost7384
\[\begin{array}{l} t_1 := -\log y\\ t_2 := \log y \cdot x\\ \mathbf{if}\;t \leq -1.75 \cdot 10^{+56}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-77}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-282}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.9 \cdot 10^{+91}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 4
Error0.5
Cost7232
\[\left(\left(x - 1\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t \]
Alternative 5
Error7.9
Cost6984
\[\begin{array}{l} t_1 := \log y \cdot x - t\\ \mathbf{if}\;t \leq -29000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 330:\\ \;\;\;\;\left(x - 1\right) \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error7.3
Cost6976
\[\left(y + \left(x - 1\right) \cdot \log y\right) - t \]
Alternative 7
Error15.3
Cost6920
\[\begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -1.95 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+64}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error7.4
Cost6848
\[\left(x - 1\right) \cdot \log y - t \]
Alternative 9
Error30.1
Cost6792
\[\begin{array}{l} \mathbf{if}\;t \leq -0.26:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+15}:\\ \;\;\;\;-\log y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 10
Error36.2
Cost584
\[\begin{array}{l} \mathbf{if}\;t \leq -28500:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{+15}:\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 11
Error36.4
Cost520
\[\begin{array}{l} \mathbf{if}\;t \leq -28500:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
Alternative 12
Error40.6
Cost128
\[-t \]

Error

Reproduce?

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