Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B

Percentage Accurate: 99.8% → 99.8%
Time: 14.2s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \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 \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* 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 (((((x * log(y)) + z) + 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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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 \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* 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 (((((x * log(y)) + z) + 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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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 \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* 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 (((((x * log(y)) + z) + 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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Final simplification99.9%

    \[\leadsto \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 \]
  4. Add Preprocessing

Alternative 2: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + b \cdot \log c\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (* y i) (+ (+ (+ (+ (* x (log y)) z) t) a) (* b (log c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + (((((x * log(y)) + z) + t) + a) + (b * log(c)));
}
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 = (y * i) + (((((x * log(y)) + z) + t) + a) + (b * log(c)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + (((((x * Math.log(y)) + z) + t) + a) + (b * Math.log(c)));
}
def code(x, y, z, t, a, b, c, i):
	return (y * i) + (((((x * math.log(y)) + z) + t) + a) + (b * math.log(c)))
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(y * i) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(b * log(c))))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (y * i) + (((((x * log(y)) + z) + t) + a) + (b * log(c)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + b \cdot \log c\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Taylor expanded in b around inf 98.8%

    \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
  4. Step-by-step derivation
    1. *-commutative98.8%

      \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  5. Simplified98.8%

    \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  6. Final simplification98.8%

    \[\leadsto y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + b \cdot \log c\right) \]
  7. Add Preprocessing

Alternative 3: 67.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+117} \lor \neg \left(b - 0.5 \leq 4 \cdot 10^{+125}\right):\\ \;\;\;\;y \cdot i + \left(t + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (- b 0.5) -5e+117) (not (<= (- b 0.5) 4e+125)))
   (+ (* y i) (+ t (+ z (* (- b 0.5) (log c)))))
   (+ (* y i) (+ (+ z a) (* (log c) -0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((b - 0.5) <= -5e+117) || !((b - 0.5) <= 4e+125)) {
		tmp = (y * i) + (t + (z + ((b - 0.5) * log(c))));
	} else {
		tmp = (y * i) + ((z + a) + (log(c) * -0.5));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (((b - 0.5d0) <= (-5d+117)) .or. (.not. ((b - 0.5d0) <= 4d+125))) then
        tmp = (y * i) + (t + (z + ((b - 0.5d0) * log(c))))
    else
        tmp = (y * i) + ((z + a) + (log(c) * (-0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((b - 0.5) <= -5e+117) || !((b - 0.5) <= 4e+125)) {
		tmp = (y * i) + (t + (z + ((b - 0.5) * Math.log(c))));
	} else {
		tmp = (y * i) + ((z + a) + (Math.log(c) * -0.5));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((b - 0.5) <= -5e+117) or not ((b - 0.5) <= 4e+125):
		tmp = (y * i) + (t + (z + ((b - 0.5) * math.log(c))))
	else:
		tmp = (y * i) + ((z + a) + (math.log(c) * -0.5))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(b - 0.5) <= -5e+117) || !(Float64(b - 0.5) <= 4e+125))
		tmp = Float64(Float64(y * i) + Float64(t + Float64(z + Float64(Float64(b - 0.5) * log(c)))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(log(c) * -0.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((b - 0.5) <= -5e+117) || ~(((b - 0.5) <= 4e+125)))
		tmp = (y * i) + (t + (z + ((b - 0.5) * log(c))));
	else
		tmp = (y * i) + ((z + a) + (log(c) * -0.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(b - 0.5), $MachinePrecision], -5e+117], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 4e+125]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+117} \lor \neg \left(b - 0.5 \leq 4 \cdot 10^{+125}\right):\\
\;\;\;\;y \cdot i + \left(t + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -4.99999999999999983e117 or 3.9999999999999997e125 < (-.f64 b 1/2)

    1. Initial program 99.7%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 89.7%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in a around 0 82.8%

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

    if -4.99999999999999983e117 < (-.f64 b 1/2) < 3.9999999999999997e125

    1. Initial program 99.9%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 80.9%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in b around 0 79.4%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{-0.5 \cdot \log c}\right) + y \cdot i \]
    5. Taylor expanded in t around 0 64.1%

      \[\leadsto \color{blue}{\left(a + \left(z + -0.5 \cdot \log c\right)\right)} + y \cdot i \]
    6. Step-by-step derivation
      1. associate-+r+64.1%

        \[\leadsto \color{blue}{\left(\left(a + z\right) + -0.5 \cdot \log c\right)} + y \cdot i \]
    7. Simplified64.1%

      \[\leadsto \color{blue}{\left(\left(a + z\right) + -0.5 \cdot \log c\right)} + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+117} \lor \neg \left(b - 0.5 \leq 4 \cdot 10^{+125}\right):\\ \;\;\;\;y \cdot i + \left(t + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 62.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.1 \cdot 10^{+150} \lor \neg \left(b \leq 3.15 \cdot 10^{+150}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= b -6.1e+150) (not (<= b 3.15e+150)))
   (+ (* y i) (* b (log c)))
   (+ (* y i) (+ (+ z a) (* (log c) -0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((b <= -6.1e+150) || !(b <= 3.15e+150)) {
		tmp = (y * i) + (b * log(c));
	} else {
		tmp = (y * i) + ((z + a) + (log(c) * -0.5));
	}
	return tmp;
}
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
    real(8) :: tmp
    if ((b <= (-6.1d+150)) .or. (.not. (b <= 3.15d+150))) then
        tmp = (y * i) + (b * log(c))
    else
        tmp = (y * i) + ((z + a) + (log(c) * (-0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((b <= -6.1e+150) || !(b <= 3.15e+150)) {
		tmp = (y * i) + (b * Math.log(c));
	} else {
		tmp = (y * i) + ((z + a) + (Math.log(c) * -0.5));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (b <= -6.1e+150) or not (b <= 3.15e+150):
		tmp = (y * i) + (b * math.log(c))
	else:
		tmp = (y * i) + ((z + a) + (math.log(c) * -0.5))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((b <= -6.1e+150) || !(b <= 3.15e+150))
		tmp = Float64(Float64(y * i) + Float64(b * log(c)));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(log(c) * -0.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((b <= -6.1e+150) || ~((b <= 3.15e+150)))
		tmp = (y * i) + (b * log(c));
	else
		tmp = (y * i) + ((z + a) + (log(c) * -0.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -6.1e+150], N[Not[LessEqual[b, 3.15e+150]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.1 \cdot 10^{+150} \lor \neg \left(b \leq 3.15 \cdot 10^{+150}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.10000000000000026e150 or 3.15000000000000015e150 < b

    1. Initial program 99.6%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 89.1%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in b around inf 72.1%

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
    5. Step-by-step derivation
      1. *-commutative72.1%

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Simplified72.1%

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]

    if -6.10000000000000026e150 < b < 3.15000000000000015e150

    1. Initial program 99.9%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 81.7%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in b around 0 77.9%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{-0.5 \cdot \log c}\right) + y \cdot i \]
    5. Taylor expanded in t around 0 63.6%

      \[\leadsto \color{blue}{\left(a + \left(z + -0.5 \cdot \log c\right)\right)} + y \cdot i \]
    6. Step-by-step derivation
      1. associate-+r+63.6%

        \[\leadsto \color{blue}{\left(\left(a + z\right) + -0.5 \cdot \log c\right)} + y \cdot i \]
    7. Simplified63.6%

      \[\leadsto \color{blue}{\left(\left(a + z\right) + -0.5 \cdot \log c\right)} + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.1 \cdot 10^{+150} \lor \neg \left(b \leq 3.15 \cdot 10^{+150}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.3 \cdot 10^{+151} \lor \neg \left(b \leq 3.3 \cdot 10^{+154}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= b -3.3e+151) (not (<= b 3.3e+154)))
   (+ (* y i) (* b (log c)))
   (+ (* y i) (+ z (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((b <= -3.3e+151) || !(b <= 3.3e+154)) {
		tmp = (y * i) + (b * log(c));
	} else {
		tmp = (y * i) + (z + (t + a));
	}
	return tmp;
}
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
    real(8) :: tmp
    if ((b <= (-3.3d+151)) .or. (.not. (b <= 3.3d+154))) then
        tmp = (y * i) + (b * log(c))
    else
        tmp = (y * i) + (z + (t + a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((b <= -3.3e+151) || !(b <= 3.3e+154)) {
		tmp = (y * i) + (b * Math.log(c));
	} else {
		tmp = (y * i) + (z + (t + a));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (b <= -3.3e+151) or not (b <= 3.3e+154):
		tmp = (y * i) + (b * math.log(c))
	else:
		tmp = (y * i) + (z + (t + a))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((b <= -3.3e+151) || !(b <= 3.3e+154))
		tmp = Float64(Float64(y * i) + Float64(b * log(c)));
	else
		tmp = Float64(Float64(y * i) + Float64(z + Float64(t + a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((b <= -3.3e+151) || ~((b <= 3.3e+154)))
		tmp = (y * i) + (b * log(c));
	else
		tmp = (y * i) + (z + (t + a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -3.3e+151], N[Not[LessEqual[b, 3.3e+154]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.3 \cdot 10^{+151} \lor \neg \left(b \leq 3.3 \cdot 10^{+154}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.30000000000000025e151 or 3.3e154 < b

    1. Initial program 99.6%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 89.1%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in b around inf 72.1%

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
    5. Step-by-step derivation
      1. *-commutative72.1%

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Simplified72.1%

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]

    if -3.30000000000000025e151 < b < 3.3e154

    1. Initial program 99.9%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 81.7%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Step-by-step derivation
      1. add-cube-cbrt81.6%

        \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{\left(\sqrt[3]{\left(b - 0.5\right) \cdot \log c} \cdot \sqrt[3]{\left(b - 0.5\right) \cdot \log c}\right) \cdot \sqrt[3]{\left(b - 0.5\right) \cdot \log c}}\right) + y \cdot i \]
      2. pow381.6%

        \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{{\left(\sqrt[3]{\left(b - 0.5\right) \cdot \log c}\right)}^{3}}\right) + y \cdot i \]
      3. *-un-lft-identity81.6%

        \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\color{blue}{\left(1 \cdot \left(b - 0.5\right)\right)} \cdot \log c}\right)}^{3}\right) + y \cdot i \]
      4. sub-neg81.6%

        \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\left(1 \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) \cdot \log c}\right)}^{3}\right) + y \cdot i \]
      5. *-un-lft-identity81.6%

        \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\color{blue}{\left(b + \left(-0.5\right)\right)} \cdot \log c}\right)}^{3}\right) + y \cdot i \]
      6. metadata-eval81.6%

        \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\left(b + \color{blue}{-0.5}\right) \cdot \log c}\right)}^{3}\right) + y \cdot i \]
    5. Applied egg-rr81.6%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{{\left(\sqrt[3]{\left(b + -0.5\right) \cdot \log c}\right)}^{3}}\right) + y \cdot i \]
    6. Taylor expanded in b around inf 77.0%

      \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
    7. Step-by-step derivation
      1. +-commutative77.0%

        \[\leadsto \color{blue}{\left(\left(t + z\right) + a\right)} + y \cdot i \]
      2. associate-+r+77.0%

        \[\leadsto \color{blue}{\left(t + \left(z + a\right)\right)} + y \cdot i \]
      3. +-commutative77.0%

        \[\leadsto \color{blue}{\left(\left(z + a\right) + t\right)} + y \cdot i \]
      4. associate-+l+77.0%

        \[\leadsto \color{blue}{\left(z + \left(a + t\right)\right)} + y \cdot i \]
    8. Simplified77.0%

      \[\leadsto \color{blue}{\left(z + \left(a + t\right)\right)} + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.3 \cdot 10^{+151} \lor \neg \left(b \leq 3.3 \cdot 10^{+154}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 84.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(z + t\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (* y i) (+ (* (- b 0.5) (log c)) (+ a (+ z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + (((b - 0.5) * log(c)) + (a + (z + t)));
}
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 = (y * i) + (((b - 0.5d0) * log(c)) + (a + (z + t)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + (((b - 0.5) * Math.log(c)) + (a + (z + t)));
}
def code(x, y, z, t, a, b, c, i):
	return (y * i) + (((b - 0.5) * math.log(c)) + (a + (z + t)))
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(a + Float64(z + t))))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (z + t)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(z + t\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Taylor expanded in x around 0 83.3%

    \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  4. Final simplification83.3%

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

Alternative 7: 68.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ y \cdot i + \left(\left(z + a\right) + \log c \cdot \left(b + -0.5\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (* y i) (+ (+ z a) (* (log c) (+ b -0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + ((z + a) + (log(c) * (b + -0.5)));
}
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 = (y * i) + ((z + a) + (log(c) * (b + (-0.5d0))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + ((z + a) + (Math.log(c) * (b + -0.5)));
}
def code(x, y, z, t, a, b, c, i):
	return (y * i) + ((z + a) + (math.log(c) * (b + -0.5)))
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(log(c) * Float64(b + -0.5))))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (y * i) + ((z + a) + (log(c) * (b + -0.5)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot i + \left(\left(z + a\right) + \log c \cdot \left(b + -0.5\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Taylor expanded in x around 0 83.3%

    \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  4. Taylor expanded in t around 0 70.1%

    \[\leadsto \color{blue}{\left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)} + y \cdot i \]
  5. Step-by-step derivation
    1. associate-+r+70.1%

      \[\leadsto \color{blue}{\left(\left(a + z\right) + \log c \cdot \left(b - 0.5\right)\right)} + y \cdot i \]
    2. sub-neg70.1%

      \[\leadsto \left(\left(a + z\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) + y \cdot i \]
    3. metadata-eval70.1%

      \[\leadsto \left(\left(a + z\right) + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right) + y \cdot i \]
  6. Simplified70.1%

    \[\leadsto \color{blue}{\left(\left(a + z\right) + \log c \cdot \left(b + -0.5\right)\right)} + y \cdot i \]
  7. Final simplification70.1%

    \[\leadsto y \cdot i + \left(\left(z + a\right) + \log c \cdot \left(b + -0.5\right)\right) \]
  8. Add Preprocessing

Alternative 8: 42.1% accurate, 21.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+43}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -3.2e+43) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -3.2e+43) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (z <= (-3.2d+43)) then
        tmp = z + (y * i)
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -3.2e+43) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -3.2e+43:
		tmp = z + (y * i)
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -3.2e+43)
		tmp = Float64(z + Float64(y * i));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -3.2e+43)
		tmp = z + (y * i);
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3.2e+43], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+43}:\\
\;\;\;\;z + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.20000000000000014e43

    1. Initial program 99.9%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 90.9%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in b around 0 82.6%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{-0.5 \cdot \log c}\right) + y \cdot i \]
    5. Taylor expanded in z around inf 59.9%

      \[\leadsto \color{blue}{z} + y \cdot i \]

    if -3.20000000000000014e43 < z

    1. Initial program 99.8%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 81.2%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in a around inf 40.0%

      \[\leadsto \color{blue}{a} + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+43}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 67.7% accurate, 24.3× speedup?

\[\begin{array}{l} \\ y \cdot i + \left(z + \left(t + a\right)\right) \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ z (+ t a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + (z + (t + a));
}
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 = (y * i) + (z + (t + a))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + (z + (t + a));
}
def code(x, y, z, t, a, b, c, i):
	return (y * i) + (z + (t + a))
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(y * i) + Float64(z + Float64(t + a)))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (y * i) + (z + (t + a));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot i + \left(z + \left(t + a\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Taylor expanded in x around 0 83.3%

    \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  4. Step-by-step derivation
    1. add-cube-cbrt83.1%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{\left(\sqrt[3]{\left(b - 0.5\right) \cdot \log c} \cdot \sqrt[3]{\left(b - 0.5\right) \cdot \log c}\right) \cdot \sqrt[3]{\left(b - 0.5\right) \cdot \log c}}\right) + y \cdot i \]
    2. pow383.1%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{{\left(\sqrt[3]{\left(b - 0.5\right) \cdot \log c}\right)}^{3}}\right) + y \cdot i \]
    3. *-un-lft-identity83.1%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\color{blue}{\left(1 \cdot \left(b - 0.5\right)\right)} \cdot \log c}\right)}^{3}\right) + y \cdot i \]
    4. sub-neg83.1%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\left(1 \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) \cdot \log c}\right)}^{3}\right) + y \cdot i \]
    5. *-un-lft-identity83.1%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\color{blue}{\left(b + \left(-0.5\right)\right)} \cdot \log c}\right)}^{3}\right) + y \cdot i \]
    6. metadata-eval83.1%

      \[\leadsto \left(\left(\left(z + t\right) + a\right) + {\left(\sqrt[3]{\left(b + \color{blue}{-0.5}\right) \cdot \log c}\right)}^{3}\right) + y \cdot i \]
  5. Applied egg-rr83.1%

    \[\leadsto \left(\left(\left(z + t\right) + a\right) + \color{blue}{{\left(\sqrt[3]{\left(b + -0.5\right) \cdot \log c}\right)}^{3}}\right) + y \cdot i \]
  6. Taylor expanded in b around inf 66.7%

    \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
  7. Step-by-step derivation
    1. +-commutative66.7%

      \[\leadsto \color{blue}{\left(\left(t + z\right) + a\right)} + y \cdot i \]
    2. associate-+r+66.7%

      \[\leadsto \color{blue}{\left(t + \left(z + a\right)\right)} + y \cdot i \]
    3. +-commutative66.7%

      \[\leadsto \color{blue}{\left(\left(z + a\right) + t\right)} + y \cdot i \]
    4. associate-+l+66.7%

      \[\leadsto \color{blue}{\left(z + \left(a + t\right)\right)} + y \cdot i \]
  8. Simplified66.7%

    \[\leadsto \color{blue}{\left(z + \left(a + t\right)\right)} + y \cdot i \]
  9. Final simplification66.7%

    \[\leadsto y \cdot i + \left(z + \left(t + a\right)\right) \]
  10. Add Preprocessing

Alternative 10: 27.0% accurate, 27.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.8 \cdot 10^{+108}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.8e+108) (* y i) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 1.8e+108) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
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
    real(8) :: tmp
    if (a <= 1.8d+108) then
        tmp = y * i
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 1.8e+108) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 1.8e+108:
		tmp = y * i
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 1.8e+108)
		tmp = Float64(y * i);
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (a <= 1.8e+108)
		tmp = y * i;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.8e+108], N[(y * i), $MachinePrecision], a]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.8 \cdot 10^{+108}:\\
\;\;\;\;y \cdot i\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.8e108

    1. Initial program 99.8%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 82.1%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in a around inf 33.6%

      \[\leadsto \color{blue}{a} + y \cdot i \]
    5. Taylor expanded in a around 0 24.6%

      \[\leadsto \color{blue}{i \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative24.6%

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified24.6%

      \[\leadsto \color{blue}{y \cdot i} \]

    if 1.8e108 < a

    1. Initial program 100.0%

      \[\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. Add Preprocessing
    3. Taylor expanded in x around 0 89.1%

      \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Taylor expanded in a around inf 60.8%

      \[\leadsto \color{blue}{a} + y \cdot i \]
    5. Taylor expanded in a around inf 50.9%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.8 \cdot 10^{+108}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 37.6% accurate, 43.8× speedup?

\[\begin{array}{l} \\ a + y \cdot i \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (+ a (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a + (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 = a + (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 a + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return a + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(a + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
a + y \cdot i
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Taylor expanded in x around 0 83.3%

    \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  4. Taylor expanded in a around inf 38.2%

    \[\leadsto \color{blue}{a} + y \cdot i \]
  5. Final simplification38.2%

    \[\leadsto a + y \cdot i \]
  6. Add Preprocessing

Alternative 12: 16.1% accurate, 219.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
def code(x, y, z, t, a, b, c, i):
	return a
function code(x, y, z, t, a, b, c, i)
	return a
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}

\\
a
\end{array}
Derivation
  1. Initial program 99.9%

    \[\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. Add Preprocessing
  3. Taylor expanded in x around 0 83.3%

    \[\leadsto \left(\left(\left(\color{blue}{z} + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  4. Taylor expanded in a around inf 38.2%

    \[\leadsto \color{blue}{a} + y \cdot i \]
  5. Taylor expanded in a around inf 18.0%

    \[\leadsto \color{blue}{a} \]
  6. Final simplification18.0%

    \[\leadsto a \]
  7. Add Preprocessing

Reproduce

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