Average Error: 0.1 → 0.1
Time: 33.0s
Precision: binary64
Cost: 14016
\[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
\[\left(\left(\left(\left(z + x \cdot \log y\right) + t\right) + a\right) + \left(b + -0.5\right) \cdot \log c\right) + y \cdot i \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ z (* x (log y))) t) a) (* (+ b -0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((z + (x * log(y))) + t) + a) + ((b + -0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
    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
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
real(8) function code(x, y, z, t, a, b, c, i)
    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
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = ((((z + (x * log(y))) + t) + a) + ((b + (-0.5d0)) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((z + (x * Math.log(y))) + t) + a) + ((b + -0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
def code(x, y, z, t, a, b, c, i):
	return ((((z + (x * math.log(y))) + t) + a) + ((b + -0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(z + Float64(x * log(y))) + t) + a) + Float64(Float64(b + -0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = ((((z + (x * log(y))) + t) + a) + ((b + -0.5) * log(c))) + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\left(\left(\left(\left(z + x \cdot \log y\right) + t\right) + a\right) + \left(b + -0.5\right) \cdot \log c\right) + y \cdot i

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

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

Alternatives

Alternative 1
Error26.3
Cost61024
\[\begin{array}{l} t_1 := y \cdot i + x \cdot \log y\\ t_2 := b \cdot \log c\\ t_3 := t + \left(z + \left(a + \log c \cdot -0.5\right)\right)\\ t_4 := \left(b + -0.5\right) \cdot \log c\\ \mathbf{if}\;t_4 \leq -2 \cdot 10^{+192}:\\ \;\;\;\;t + \left(z + t_2\right)\\ \mathbf{elif}\;t_4 \leq -105:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_4 \leq -80:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_4 \leq -20:\\ \;\;\;\;a + y \cdot i\\ \mathbf{elif}\;t_4 \leq -0.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_4 \leq 2 \cdot 10^{+58}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_4 \leq 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_4 \leq 5 \cdot 10^{+152}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + t_2\\ \end{array} \]
Alternative 2
Error21.2
Cost47832
\[\begin{array}{l} t_1 := \left(b + -0.5\right) \cdot \log c\\ t_2 := t + \left(z + \left(a + t_1\right)\right)\\ t_3 := y \cdot i + x \cdot \log y\\ \mathbf{if}\;t_1 \leq -105:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -80:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq -20:\\ \;\;\;\;a + y \cdot i\\ \mathbf{elif}\;t_1 \leq -0.5:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+58}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+91}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error2.7
Cost13896
\[\begin{array}{l} t_1 := t + \left(b \cdot \log c + \left(x \cdot \log y + \left(z + a\right)\right)\right)\\ \mathbf{if}\;x \leq -4.457233717977077 \cdot 10^{+124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.9805996393048335 \cdot 10^{+74}:\\ \;\;\;\;y \cdot i + \left(\left(b + -0.5\right) \cdot \log c + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error1.4
Cost13888
\[y \cdot i + \left(\left(\left(\left(z + x \cdot \log y\right) + t\right) + a\right) + b \cdot \log c\right) \]
Alternative 5
Error38.1
Cost7904
\[\begin{array}{l} t_1 := y \cdot i + x \cdot \log y\\ t_2 := a + b \cdot \log c\\ \mathbf{if}\;z \leq -1.7144548225772646 \cdot 10^{+195}:\\ \;\;\;\;t + \left(z + a\right)\\ \mathbf{elif}\;z \leq -3.234758244539924 \cdot 10^{+115}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -2.8842571459646715 \cdot 10^{+105}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.074654082572528 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.0434980680690302 \cdot 10^{-7}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -4.98924912167695 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.4623018274628845 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -9.709093290626228 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error5.2
Cost7880
\[\begin{array}{l} t_1 := a + \left(z + t\right)\\ t_2 := y \cdot i + \left(\left(b + -0.5\right) \cdot \log c + t_1\right)\\ \mathbf{if}\;b + -0.5 \leq -1 \cdot 10^{+68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b + -0.5 \leq 10^{+118}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error7.2
Cost7752
\[\begin{array}{l} t_1 := t + \left(z + \left(a + \left(b + -0.5\right) \cdot \log c\right)\right)\\ \mathbf{if}\;b + -0.5 \leq -1 \cdot 10^{+176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b + -0.5 \leq 5 \cdot 10^{+244}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error7.2
Cost7752
\[\begin{array}{l} t_1 := \left(b + -0.5\right) \cdot \log c\\ \mathbf{if}\;b + -0.5 \leq -1 \cdot 10^{+176}:\\ \;\;\;\;t + \left(z + \left(a + t_1\right)\right)\\ \mathbf{elif}\;b + -0.5 \leq 5 \cdot 10^{+244}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(t_1 + \left(z + t\right)\right)\\ \end{array} \]
Alternative 9
Error6.5
Cost7752
\[\begin{array}{l} t_1 := \left(b + -0.5\right) \cdot \log c\\ \mathbf{if}\;b + -0.5 \leq -1 \cdot 10^{+176}:\\ \;\;\;\;t + \left(z + \left(a + t_1\right)\right)\\ \mathbf{elif}\;b + -0.5 \leq 2 \cdot 10^{+195}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + t_1\right)\right)\\ \end{array} \]
Alternative 10
Error38.0
Cost7248
\[\begin{array}{l} t_1 := z + y \cdot i\\ t_2 := a + b \cdot \log c\\ \mathbf{if}\;z \leq -1.7144548225772646 \cdot 10^{+195}:\\ \;\;\;\;t + \left(z + a\right)\\ \mathbf{elif}\;z \leq -3.234758244539924 \cdot 10^{+115}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.8842571459646715 \cdot 10^{+105}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.074654082572528 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error40.2
Cost716
\[\begin{array}{l} t_1 := t + \left(z + a\right)\\ \mathbf{if}\;z \leq -1.7144548225772646 \cdot 10^{+195}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.234758244539924 \cdot 10^{+115}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -548911471479029600:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
Alternative 12
Error41.4
Cost452
\[\begin{array}{l} \mathbf{if}\;z \leq -548911471479029600:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
Alternative 13
Error39.3
Cost452
\[\begin{array}{l} \mathbf{if}\;z \leq -548911471479029600:\\ \;\;\;\;t + \left(z + a\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
Alternative 14
Error39.9
Cost324
\[\begin{array}{l} \mathbf{if}\;a \leq 2.2094381699433626 \cdot 10^{+77}:\\ \;\;\;\;z + t\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 15
Error38.4
Cost324
\[\begin{array}{l} \mathbf{if}\;a \leq 2.2094381699433626 \cdot 10^{+77}:\\ \;\;\;\;z + t\\ \mathbf{else}:\\ \;\;\;\;t + a\\ \end{array} \]
Alternative 16
Error42.3
Cost324
\[\begin{array}{l} \mathbf{if}\;y \leq 2.9 \cdot 10^{+236}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]
Alternative 17
Error48.9
Cost196
\[\begin{array}{l} \mathbf{if}\;a \leq 2.2094381699433626 \cdot 10^{+77}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 18
Error42.3
Cost192
\[z + a \]
Alternative 19
Error52.7
Cost64
\[z \]

Error

Reproduce

herbie shell --seed 2022317 
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  :precision binary64
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))