?

Average Error: 0.1 → 0.1
Time: 22.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 \]
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b \]
(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 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 + 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 + y) + z) - (z * log(t))) + ((a + -0.5) * b);
}
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 + y) + z) - (z * log(t))) + ((a + (-0.5d0)) * b)
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 + y) + z) - (z * Math.log(t))) + ((a + -0.5) * b);
}
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 + y) + z) - (z * math.log(t))) + ((a + -0.5) * b)
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(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a + -0.5) * b))
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 + y) + z) - (z * log(t))) + ((a + -0.5) * b);
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[(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]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.3
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. Final simplification0.1

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

Alternatives

Alternative 1
Error31.4
Cost8668
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ t_2 := x + t_1\\ t_3 := x + z \cdot \left(1 - \log t\right)\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{+221}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+121}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+58}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq -1 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{-163}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq 1.6 \cdot 10^{-99}:\\ \;\;\;\;z + t_1\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{-15}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;y + t_1\\ \end{array} \]
Alternative 2
Error31.4
Cost8668
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ t_2 := x + t_1\\ t_3 := x + z \cdot \left(1 - \log t\right)\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{+221}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+121}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+58}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq -1 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{-163}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq 1.6 \cdot 10^{-99}:\\ \;\;\;\;z + t_1\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{-15}:\\ \;\;\;\;x + \left(z - z \cdot \log t\right)\\ \mathbf{else}:\\ \;\;\;\;y + t_1\\ \end{array} \]
Alternative 3
Error23.9
Cost8144
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ t_2 := z \cdot \left(1 - \log t\right)\\ t_3 := x + t_2\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{+221}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+121}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+74}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+47}:\\ \;\;\;\;t_1 + t_2\\ \mathbf{else}:\\ \;\;\;\;y + t_1\\ \end{array} \]
Alternative 4
Error22.9
Cost8144
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ t_2 := z \cdot \left(1 - \log t\right)\\ t_3 := x + t_2\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{+221}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+121}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+74}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-47}:\\ \;\;\;\;t_1 + t_2\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot -0.5 + \left(y + z\right)\right) - z \cdot \log t\\ \end{array} \]
Alternative 5
Error6.6
Cost8008
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+207}:\\ \;\;\;\;y + t_1\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+186}:\\ \;\;\;\;\left(b \cdot -0.5 + \left(y + \left(x + z\right)\right)\right) - z \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;t_1 + z \cdot \left(1 - \log t\right)\\ \end{array} \]
Alternative 6
Error31.4
Cost7760
\[\begin{array}{l} t_1 := z \cdot \left(1 - \log t\right)\\ t_2 := \left(a + -0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{-74}:\\ \;\;\;\;x + t_2\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x + y \leq 1.6 \cdot 10^{-99}:\\ \;\;\;\;z + t_2\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{-15}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y + t_2\\ \end{array} \]
Alternative 7
Error31.4
Cost7760
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{-74}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{-163}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;x + y \leq 1.6 \cdot 10^{-99}:\\ \;\;\;\;z + t_1\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{-15}:\\ \;\;\;\;z - z \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;y + t_1\\ \end{array} \]
Alternative 8
Error10.6
Cost7753
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+197} \lor \neg \left(t_1 \leq 2 \cdot 10^{+92}\right):\\ \;\;\;\;y + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\ \end{array} \]
Alternative 9
Error22.0
Cost7624
\[\begin{array}{l} t_1 := z \cdot \log t\\ \mathbf{if}\;x + y \leq -400000000:\\ \;\;\;\;\left(b \cdot -0.5 + \left(x + z\right)\right) - t_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-47}:\\ \;\;\;\;\left(a + -0.5\right) \cdot b + z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot -0.5 + \left(y + z\right)\right) - t_1\\ \end{array} \]
Alternative 10
Error26.0
Cost1097
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+203} \lor \neg \left(t_1 \leq 10^{+79}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 11
Error31.7
Cost840
\[\begin{array}{l} \mathbf{if}\;x + y \leq -2 \cdot 10^{-41}:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\left(a + -0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 12
Error37.1
Cost840
\[\begin{array}{l} \mathbf{if}\;x + y \leq -2 \cdot 10^{-41}:\\ \;\;\;\;x + a \cdot b\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-86}:\\ \;\;\;\;\left(a + -0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot -0.5\\ \end{array} \]
Alternative 13
Error37.2
Cost840
\[\begin{array}{l} \mathbf{if}\;x + y \leq -20:\\ \;\;\;\;x + b \cdot -0.5\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-86}:\\ \;\;\;\;\left(a + -0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot -0.5\\ \end{array} \]
Alternative 14
Error38.6
Cost712
\[\begin{array}{l} \mathbf{if}\;x + y \leq -2 \cdot 10^{-7}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-86}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 15
Error33.8
Cost708
\[\begin{array}{l} \mathbf{if}\;x + y \leq 2 \cdot 10^{-86}:\\ \;\;\;\;x + \left(a + -0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot -0.5\\ \end{array} \]
Alternative 16
Error30.7
Cost708
\[\begin{array}{l} t_1 := \left(a + -0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{-76}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;y + t_1\\ \end{array} \]
Alternative 17
Error43.7
Cost460
\[\begin{array}{l} \mathbf{if}\;y \leq 4.3 \cdot 10^{-148}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-75}:\\ \;\;\;\;b \cdot -0.5\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 18
Error43.7
Cost460
\[\begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{-132}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-74}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+49}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 19
Error43.3
Cost196
\[\begin{array}{l} \mathbf{if}\;y \leq 1.65 \cdot 10^{+50}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 20
Error47.6
Cost64
\[x \]

Error

Reproduce?

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