?

Average Error: 0.1 → 0.1
Time: 18.3s
Precision: binary64
Cost: 7360

?

\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
\[x + \left(\left(1 - \log t\right) \cdot z + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
(FPCore (x y z t a b)
 :precision binary64
 (+ x (+ (* (- 1.0 (log t)) z) (+ (* (- a 0.5) b) y))))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
	return x + (((1.0 - log(t)) * z) + (((a - 0.5) * b) + y));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x + (((1.0d0 - log(t)) * z) + (((a - 0.5d0) * b) + y))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return x + (((1.0 - Math.log(t)) * z) + (((a - 0.5) * b) + y));
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
def code(x, y, z, t, a, b):
	return x + (((1.0 - math.log(t)) * z) + (((a - 0.5) * b) + y))
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function code(x, y, z, t, a, b)
	return Float64(x + Float64(Float64(Float64(1.0 - log(t)) * z) + Float64(Float64(Float64(a - 0.5) * b) + y)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
function tmp = code(x, y, z, t, a, b)
	tmp = x + (((1.0 - log(t)) * z) + (((a - 0.5) * b) + y));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
x + \left(\left(1 - \log t\right) \cdot z + \left(\left(a - 0.5\right) \cdot b + y\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.4
Herbie0.1
\[\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b \]

Derivation?

  1. Initial program 0.1

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Simplified0.1

    \[\leadsto \color{blue}{x + \left(y + \left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)\right)} \]
    Proof

    [Start]0.1

    \[ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]

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

    \[ \color{blue}{\left(a - 0.5\right) \cdot b + \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right)} \]

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

    \[ \left(a - 0.5\right) \cdot b + \left(\color{blue}{\left(z + \left(x + y\right)\right)} - z \cdot \log t\right) \]

    rational.json-simplify-48 [=>]0.1

    \[ \left(a - 0.5\right) \cdot b + \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} \]

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

    \[ \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)} \]

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

    \[ \color{blue}{\left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right) + \left(x + y\right)} \]

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

    \[ \color{blue}{x + \left(y + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)\right)} \]

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

    \[ x + \left(y + \color{blue}{\left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)}\right) \]
  3. Taylor expanded in z around 0 0.1

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

    \[\leadsto x + \left(\left(1 - \log t\right) \cdot z + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]

Alternatives

Alternative 1
Error11.4
Cost8272
\[\begin{array}{l} t_1 := z \cdot \log t\\ t_2 := x + \left(y + \left(\left(-0.5 \cdot b + z\right) - t_1\right)\right)\\ t_3 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq 4 \cdot 10^{-15}:\\ \;\;\;\;x + \left(\left(t_3 + z\right) - t_1\right)\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+100}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x + y \leq 10^{+107}:\\ \;\;\;\;\left(1 - \log t\right) \cdot z + t_3\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+181}:\\ \;\;\;\;x + \left(t_3 + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error11.4
Cost8272
\[\begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ t_2 := x + \left(y + \left(\left(-0.5 \cdot b + z\right) - z \cdot \log t\right)\right)\\ t_3 := \left(1 - \log t\right) \cdot z\\ \mathbf{if}\;x + y \leq 4 \cdot 10^{-15}:\\ \;\;\;\;t_3 + \left(t_1 + x\right)\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+100}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x + y \leq 10^{+107}:\\ \;\;\;\;t_3 + t_1\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+181}:\\ \;\;\;\;x + \left(t_1 + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error4.4
Cost7496
\[\begin{array}{l} t_1 := x + \left(y + \left(\left(-0.5 \cdot b + z\right) - z \cdot \log t\right)\right)\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{+127}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.1 \cdot 10^{+26}:\\ \;\;\;\;x + \left(\left(a - 0.5\right) \cdot b + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error0.1
Cost7360
\[x + \left(y + \left(\left(a - 0.5\right) \cdot b + \left(z - z \cdot \log t\right)\right)\right) \]
Alternative 5
Error6.3
Cost7240
\[\begin{array}{l} t_1 := x + \left(y + \left(z - z \cdot \log t\right)\right)\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{+141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+133}:\\ \;\;\;\;x + \left(\left(a - 0.5\right) \cdot b + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error6.2
Cost7240
\[\begin{array}{l} t_1 := x + \left(\left(1 - \log t\right) \cdot z + y\right)\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{+140}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+132}:\\ \;\;\;\;x + \left(\left(a - 0.5\right) \cdot b + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error8.2
Cost7112
\[\begin{array}{l} t_1 := x + \left(1 - \log t\right) \cdot z\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{+141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+145}:\\ \;\;\;\;x + \left(\left(a - 0.5\right) \cdot b + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error9.8
Cost6984
\[\begin{array}{l} t_1 := \left(1 - \log t\right) \cdot z\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+197}:\\ \;\;\;\;x + \left(\left(a - 0.5\right) \cdot b + y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error33.3
Cost1360
\[\begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -2 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+100}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq 10^{+162}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 10
Error32.3
Cost1360
\[\begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -5 \cdot 10^{-80}:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+100}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq 10^{+162}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 11
Error32.0
Cost1360
\[\begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -5 \cdot 10^{-8}:\\ \;\;\;\;-0.5 \cdot b + x\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+100}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq 10^{+162}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 12
Error27.1
Cost1228
\[\begin{array}{l} t_1 := x + \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq 5 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+100}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq 10^{+162}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 13
Error37.8
Cost712
\[\begin{array}{l} \mathbf{if}\;x + y \leq -5 \cdot 10^{-8}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + y \leq 5000000:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 14
Error25.7
Cost708
\[\begin{array}{l} \mathbf{if}\;x + y \leq 4 \cdot 10^{-15}:\\ \;\;\;\;x + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + \left(-0.5 \cdot b + y\right)\\ \end{array} \]
Alternative 15
Error15.2
Cost576
\[x + \left(\left(a - 0.5\right) \cdot b + y\right) \]
Alternative 16
Error48.8
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-8}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 17
Error47.7
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023064 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))