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

Percentage Accurate: 99.8% → 99.8%
Time: 17.5s
Alternatives: 17
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 17 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, 0.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (fma y i (fma (+ b -0.5) (log c) (+ z (fma x (log y) (+ t a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(y, i, fma((b + -0.5), log(c), (z + fma(x, log(y), (t + a)))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(z + fma(x, log(y), Float64(t + a)))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(z + N[(x * N[Log[y], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-+l+99.8%

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

      \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    3. associate-+l+99.8%

      \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    4. associate-+r+99.8%

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

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

      \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. associate-+l+99.8%

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

      \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    10. fma-define99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    11. +-commutative99.8%

      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
    12. fma-define99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
    13. sub-neg99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
    14. metadata-eval99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
    15. +-commutative99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Final simplification99.9%

    \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right) \]
  6. Add Preprocessing

Alternative 2: 91.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;y \leq 350000000:\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + t\_1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(t\_1 + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (<= y 350000000.0)
     (+ a (+ t (+ z (+ (* x (log y)) t_1))))
     (+ (* y i) (+ t_1 (+ a (+ z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = log(c) * (b - 0.5);
	double tmp;
	if (y <= 350000000.0) {
		tmp = a + (t + (z + ((x * log(y)) + t_1)));
	} else {
		tmp = (y * i) + (t_1 + (a + (z + t)));
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    if (y <= 350000000.0d0) then
        tmp = a + (t + (z + ((x * log(y)) + t_1)))
    else
        tmp = (y * i) + (t_1 + (a + (z + t)))
    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 t_1 = Math.log(c) * (b - 0.5);
	double tmp;
	if (y <= 350000000.0) {
		tmp = a + (t + (z + ((x * Math.log(y)) + t_1)));
	} else {
		tmp = (y * i) + (t_1 + (a + (z + t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	tmp = 0
	if y <= 350000000.0:
		tmp = a + (t + (z + ((x * math.log(y)) + t_1)))
	else:
		tmp = (y * i) + (t_1 + (a + (z + t)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	tmp = 0.0
	if (y <= 350000000.0)
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + t_1))));
	else
		tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(z + t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if (y <= 350000000.0)
		tmp = a + (t + (z + ((x * log(y)) + t_1)));
	else
		tmp = (y * i) + (t_1 + (a + (z + t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 350000000.0], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;y \leq 350000000:\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + t\_1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.5e8

    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 y around 0 99.1%

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

    if 3.5e8 < y

    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 91.1%

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i
\end{array}
Derivation
  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. Final simplification99.8%

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

Alternative 4: 98.2% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Derivation
  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 b around inf 98.3%

    \[\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.3%

      \[\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.3%

    \[\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.3%

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

Alternative 5: 94.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+46} \lor \neg \left(x \leq 2.4 \cdot 10^{+53}\right):\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7999999999999999e46 or 2.4e53 < x

    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 b around inf 99.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. *-commutative99.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. Simplified99.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. Taylor expanded in b around 0 90.0%

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

    if -3.7999999999999999e46 < x < 2.4e53

    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 99.9%

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

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

Alternative 6: 86.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \log c\\ \mathbf{if}\;b \leq -3.6 \cdot 10^{+257}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+249}:\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\right)\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+273}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;i \cdot \left(y + b \cdot \frac{\log c}{i}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* b (log c))))
   (if (<= b -3.6e+257)
     t_1
     (if (<= b 2e+249)
       (+ a (+ t (+ z (+ (* x (log y)) (* y i)))))
       (if (<= b 6.2e+273) t_1 (* i (+ y (* b (/ (log c) i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = b * log(c);
	double tmp;
	if (b <= -3.6e+257) {
		tmp = t_1;
	} else if (b <= 2e+249) {
		tmp = a + (t + (z + ((x * log(y)) + (y * i))));
	} else if (b <= 6.2e+273) {
		tmp = t_1;
	} else {
		tmp = i * (y + (b * (log(c) / 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) :: t_1
    real(8) :: tmp
    t_1 = b * log(c)
    if (b <= (-3.6d+257)) then
        tmp = t_1
    else if (b <= 2d+249) then
        tmp = a + (t + (z + ((x * log(y)) + (y * i))))
    else if (b <= 6.2d+273) then
        tmp = t_1
    else
        tmp = i * (y + (b * (log(c) / 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 t_1 = b * Math.log(c);
	double tmp;
	if (b <= -3.6e+257) {
		tmp = t_1;
	} else if (b <= 2e+249) {
		tmp = a + (t + (z + ((x * Math.log(y)) + (y * i))));
	} else if (b <= 6.2e+273) {
		tmp = t_1;
	} else {
		tmp = i * (y + (b * (Math.log(c) / i)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = b * math.log(c)
	tmp = 0
	if b <= -3.6e+257:
		tmp = t_1
	elif b <= 2e+249:
		tmp = a + (t + (z + ((x * math.log(y)) + (y * i))))
	elif b <= 6.2e+273:
		tmp = t_1
	else:
		tmp = i * (y + (b * (math.log(c) / i)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(b * log(c))
	tmp = 0.0
	if (b <= -3.6e+257)
		tmp = t_1;
	elseif (b <= 2e+249)
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + Float64(y * i)))));
	elseif (b <= 6.2e+273)
		tmp = t_1;
	else
		tmp = Float64(i * Float64(y + Float64(b * Float64(log(c) / i))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = b * log(c);
	tmp = 0.0;
	if (b <= -3.6e+257)
		tmp = t_1;
	elseif (b <= 2e+249)
		tmp = a + (t + (z + ((x * log(y)) + (y * i))));
	elseif (b <= 6.2e+273)
		tmp = t_1;
	else
		tmp = i * (y + (b * (log(c) / i)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.6e+257], t$95$1, If[LessEqual[b, 2e+249], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+273], t$95$1, N[(i * N[(y + N[(b * N[(N[Log[c], $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b \leq -3.6 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2 \cdot 10^{+249}:\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\right)\\

\mathbf{elif}\;b \leq 6.2 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;i \cdot \left(y + b \cdot \frac{\log c}{i}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.59999999999999984e257 or 1.9999999999999998e249 < b < 6.2000000000000002e273

    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 b around inf 99.6%

      \[\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. *-commutative99.6%

        \[\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. Simplified99.6%

      \[\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. Taylor expanded in i around inf 52.1%

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\frac{b \cdot \log c}{i} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-/l*52.0%

        \[\leadsto i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\color{blue}{b \cdot \frac{\log c}{i}} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right) \]
      2. associate-/l*52.0%

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

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(b \cdot \frac{\log c}{i} + x \cdot \frac{\log y}{i}\right)\right)\right)\right)\right)} \]
    9. Taylor expanded in b around inf 95.2%

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

    if -3.59999999999999984e257 < b < 1.9999999999999998e249

    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.2%

      \[\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.2%

        \[\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.2%

      \[\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. Taylor expanded in b around 0 88.6%

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

    if 6.2000000000000002e273 < b

    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 b around inf 100.0%

      \[\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. *-commutative100.0%

        \[\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. Simplified100.0%

      \[\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. Taylor expanded in i around inf 100.0%

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\frac{b \cdot \log c}{i} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\color{blue}{b \cdot \frac{\log c}{i}} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right) \]
      2. associate-/l*100.0%

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

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(b \cdot \frac{\log c}{i} + x \cdot \frac{\log y}{i}\right)\right)\right)\right)\right)} \]
    9. Taylor expanded in b around inf 100.0%

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{b \cdot \log c}{i}}\right) \]
    10. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto i \cdot \left(y + \color{blue}{b \cdot \frac{\log c}{i}}\right) \]
    11. Simplified100.0%

      \[\leadsto i \cdot \left(y + \color{blue}{b \cdot \frac{\log c}{i}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.6 \cdot 10^{+257}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+249}:\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\right)\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+273}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;i \cdot \left(y + b \cdot \frac{\log c}{i}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 93.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+145} \lor \neg \left(x \leq 2.05 \cdot 10^{+53}\right):\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.35000000000000011e145 or 2.05000000000000009e53 < x

    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 b around inf 99.7%

      \[\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. *-commutative99.7%

        \[\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. Simplified99.7%

      \[\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. Taylor expanded in b around 0 90.7%

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

    if -1.35000000000000011e145 < x < 2.05000000000000009e53

    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 97.7%

      \[\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. *-commutative97.7%

        \[\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. Simplified97.7%

      \[\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. Taylor expanded in x around 0 96.2%

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

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

Alternative 8: 77.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+166} \lor \neg \left(x \leq 3.2 \cdot 10^{+111}\right):\\
\;\;\;\;t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25e166 or 3.2000000000000001e111 < x

    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 b around inf 99.7%

      \[\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. *-commutative99.7%

        \[\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. Simplified99.7%

      \[\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. Taylor expanded in b around 0 89.3%

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)\right)} \]
    7. Taylor expanded in a around 0 81.0%

      \[\leadsto \color{blue}{t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)} \]

    if -1.25e166 < x < 3.2000000000000001e111

    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 97.9%

      \[\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. *-commutative97.9%

        \[\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. Simplified97.9%

      \[\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. Taylor expanded in b around 0 80.9%

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)\right)} \]
    7. Taylor expanded in x around 0 78.5%

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

        \[\leadsto a + \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} \]
      2. *-commutative78.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+166} \lor \neg \left(x \leq 3.2 \cdot 10^{+111}\right):\\ \;\;\;\;t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+155} \lor \neg \left(x \leq 8 \cdot 10^{+117}\right):\\
\;\;\;\;x \cdot \left(\log y + \frac{a}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.80000000000000042e155 or 8.0000000000000004e117 < x

    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 inf 99.6%

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

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

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

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{x}\right)\right)\right)\right)\right) \]
      4. associate-/l*99.6%

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \color{blue}{\log c \cdot \frac{b + -0.5}{x}}\right)\right)\right)\right)\right) \]
      5. +-commutative99.6%

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \log c \cdot \frac{\color{blue}{-0.5 + b}}{x}\right)\right)\right)\right)\right) \]
    5. Simplified99.6%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) \]

    if -4.80000000000000042e155 < x < 8.0000000000000004e117

    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 97.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. *-commutative97.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. Simplified97.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. Taylor expanded in b around 0 80.8%

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)\right)} \]
    7. Taylor expanded in x around 0 78.8%

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

        \[\leadsto a + \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} \]
      2. *-commutative78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+155} \lor \neg \left(x \leq 8 \cdot 10^{+117}\right):\\ \;\;\;\;x \cdot \left(\log y + \frac{a}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+173} \lor \neg \left(x \leq 4 \cdot 10^{+152}\right):\\
\;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3999999999999999e173 or 4.0000000000000002e152 < x

    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 inf 99.7%

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

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\color{blue}{i \cdot \frac{y}{x}} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)\right) \]
      2. sub-neg99.7%

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \frac{\log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}}{x}\right)\right)\right)\right)\right) \]
      3. metadata-eval99.7%

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{x}\right)\right)\right)\right)\right) \]
      4. associate-/l*99.6%

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \color{blue}{\log c \cdot \frac{b + -0.5}{x}}\right)\right)\right)\right)\right) \]
      5. +-commutative99.6%

        \[\leadsto x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(i \cdot \frac{y}{x} + \log c \cdot \frac{\color{blue}{-0.5 + b}}{x}\right)\right)\right)\right)\right) \]
    5. Simplified99.6%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]

    if -2.3999999999999999e173 < x < 4.0000000000000002e152

    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 97.9%

      \[\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. *-commutative97.9%

        \[\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. Simplified97.9%

      \[\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. Taylor expanded in b around 0 80.7%

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)\right)} \]
    7. Taylor expanded in x around 0 77.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+173} \lor \neg \left(x \leq 4 \cdot 10^{+152}\right):\\ \;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 70.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+214} \lor \neg \left(x \leq 5 \cdot 10^{+157}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1000000000000001e214 or 4.99999999999999976e157 < x

    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 b around inf 99.7%

      \[\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. *-commutative99.7%

        \[\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. Simplified99.7%

      \[\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. Taylor expanded in x around inf 71.7%

      \[\leadsto \color{blue}{x \cdot \log y} \]

    if -2.1000000000000001e214 < x < 4.99999999999999976e157

    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.0%

      \[\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.0%

        \[\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.0%

      \[\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. Taylor expanded in b around 0 81.3%

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)\right)} \]
    7. Taylor expanded in x around 0 76.3%

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

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

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

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

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

Alternative 12: 22.6% accurate, 9.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+106}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-63} \lor \neg \left(z \leq -6.2 \cdot 10^{-154}\right) \land z \leq -1.52 \cdot 10^{-195}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -1.65e+106)
   z
   (if (or (<= z -6.2e-63) (and (not (<= z -6.2e-154)) (<= z -1.52e-195)))
     (* y i)
     a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -1.65e+106) {
		tmp = z;
	} else if ((z <= -6.2e-63) || (!(z <= -6.2e-154) && (z <= -1.52e-195))) {
		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 (z <= (-1.65d+106)) then
        tmp = z
    else if ((z <= (-6.2d-63)) .or. (.not. (z <= (-6.2d-154))) .and. (z <= (-1.52d-195))) 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 (z <= -1.65e+106) {
		tmp = z;
	} else if ((z <= -6.2e-63) || (!(z <= -6.2e-154) && (z <= -1.52e-195))) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -1.65e+106:
		tmp = z
	elif (z <= -6.2e-63) or (not (z <= -6.2e-154) and (z <= -1.52e-195)):
		tmp = y * i
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -1.65e+106)
		tmp = z;
	elseif ((z <= -6.2e-63) || (!(z <= -6.2e-154) && (z <= -1.52e-195)))
		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 (z <= -1.65e+106)
		tmp = z;
	elseif ((z <= -6.2e-63) || (~((z <= -6.2e-154)) && (z <= -1.52e-195)))
		tmp = y * i;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.65e+106], z, If[Or[LessEqual[z, -6.2e-63], And[N[Not[LessEqual[z, -6.2e-154]], $MachinePrecision], LessEqual[z, -1.52e-195]]], N[(y * i), $MachinePrecision], a]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+106}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -6.2 \cdot 10^{-63} \lor \neg \left(z \leq -6.2 \cdot 10^{-154}\right) \land z \leq -1.52 \cdot 10^{-195}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.65000000000000004e106

    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 99.9%

      \[\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. *-commutative99.9%

        \[\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. Simplified99.9%

      \[\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. Taylor expanded in z around inf 35.3%

      \[\leadsto \color{blue}{z} \]

    if -1.65000000000000004e106 < z < -6.19999999999999968e-63 or -6.19999999999999963e-154 < z < -1.5200000000000001e-195

    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 y around inf 30.1%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified30.1%

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

    if -6.19999999999999968e-63 < z < -6.19999999999999963e-154 or -1.5200000000000001e-195 < z

    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 a around inf 20.8%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification24.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+106}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-63} \lor \neg \left(z \leq -6.2 \cdot 10^{-154}\right) \land z \leq -1.52 \cdot 10^{-195}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 27.6% accurate, 9.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+254}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{+57}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-270}:\\ \;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -2.4e+254)
   z
   (if (<= z -8.6e+57)
     (* i (+ y (/ z i)))
     (if (<= z -1.1e-270) (* i (+ y (/ a i))) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -2.4e+254) {
		tmp = z;
	} else if (z <= -8.6e+57) {
		tmp = i * (y + (z / i));
	} else if (z <= -1.1e-270) {
		tmp = i * (y + (a / 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 (z <= (-2.4d+254)) then
        tmp = z
    else if (z <= (-8.6d+57)) then
        tmp = i * (y + (z / i))
    else if (z <= (-1.1d-270)) then
        tmp = i * (y + (a / 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 (z <= -2.4e+254) {
		tmp = z;
	} else if (z <= -8.6e+57) {
		tmp = i * (y + (z / i));
	} else if (z <= -1.1e-270) {
		tmp = i * (y + (a / i));
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -2.4e+254:
		tmp = z
	elif z <= -8.6e+57:
		tmp = i * (y + (z / i))
	elif z <= -1.1e-270:
		tmp = i * (y + (a / i))
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -2.4e+254)
		tmp = z;
	elseif (z <= -8.6e+57)
		tmp = Float64(i * Float64(y + Float64(z / i)));
	elseif (z <= -1.1e-270)
		tmp = Float64(i * Float64(y + Float64(a / i)));
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -2.4e+254)
		tmp = z;
	elseif (z <= -8.6e+57)
		tmp = i * (y + (z / i));
	elseif (z <= -1.1e-270)
		tmp = i * (y + (a / i));
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.4e+254], z, If[LessEqual[z, -8.6e+57], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e-270], N[(i * N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], a]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+254}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -8.6 \cdot 10^{+57}:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-270}:\\
\;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.3999999999999998e254

    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 b around inf 100.0%

      \[\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. *-commutative100.0%

        \[\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. Simplified100.0%

      \[\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. Taylor expanded in z around inf 93.0%

      \[\leadsto \color{blue}{z} \]

    if -2.3999999999999998e254 < z < -8.60000000000000066e57

    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 99.9%

      \[\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. *-commutative99.9%

        \[\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. Simplified99.9%

      \[\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. Taylor expanded in i around inf 70.4%

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\frac{b \cdot \log c}{i} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-/l*70.4%

        \[\leadsto i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\color{blue}{b \cdot \frac{\log c}{i}} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right) \]
      2. associate-/l*70.3%

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

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(b \cdot \frac{\log c}{i} + x \cdot \frac{\log y}{i}\right)\right)\right)\right)\right)} \]
    9. Taylor expanded in z around inf 37.9%

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{z}{i}}\right) \]

    if -8.60000000000000066e57 < z < -1.0999999999999999e-270

    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 b around inf 97.9%

      \[\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. *-commutative97.9%

        \[\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. Simplified97.9%

      \[\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. Taylor expanded in i around inf 82.4%

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\frac{b \cdot \log c}{i} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-/l*82.4%

        \[\leadsto i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\color{blue}{b \cdot \frac{\log c}{i}} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right) \]
      2. associate-/l*82.3%

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

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(b \cdot \frac{\log c}{i} + x \cdot \frac{\log y}{i}\right)\right)\right)\right)\right)} \]
    9. Taylor expanded in a around inf 43.5%

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{a}{i}}\right) \]

    if -1.0999999999999999e-270 < z

    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 a around inf 22.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+254}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{+57}:\\ \;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-270}:\\ \;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 26.5% accurate, 12.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+106}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-270}:\\
\;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.39999999999999996e106

    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 99.9%

      \[\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. *-commutative99.9%

        \[\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. Simplified99.9%

      \[\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. Taylor expanded in z around inf 35.3%

      \[\leadsto \color{blue}{z} \]

    if -1.39999999999999996e106 < z < -1e-270

    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 b around inf 98.2%

      \[\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.2%

        \[\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.2%

      \[\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. Taylor expanded in i around inf 79.9%

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\frac{b \cdot \log c}{i} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-/l*79.9%

        \[\leadsto i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(\color{blue}{b \cdot \frac{\log c}{i}} + \frac{x \cdot \log y}{i}\right)\right)\right)\right)\right) \]
      2. associate-/l*79.8%

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

      \[\leadsto \color{blue}{i \cdot \left(y + \left(\frac{a}{i} + \left(\frac{t}{i} + \left(\frac{z}{i} + \left(b \cdot \frac{\log c}{i} + x \cdot \frac{\log y}{i}\right)\right)\right)\right)\right)} \]
    9. Taylor expanded in a around inf 41.6%

      \[\leadsto i \cdot \left(y + \color{blue}{\frac{a}{i}}\right) \]

    if -1e-270 < z

    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 a around inf 22.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+106}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-270}:\\ \;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 67.1% accurate, 24.3× speedup?

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

\\
a + \left(t + \left(z + y \cdot i\right)\right)
\end{array}
Derivation
  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 b around inf 98.3%

    \[\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.3%

      \[\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.3%

    \[\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. Taylor expanded in b around 0 83.0%

    \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + x \cdot \log y\right)\right)\right)} \]
  7. Taylor expanded in x around 0 66.3%

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

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

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

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

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

Alternative 16: 21.3% accurate, 36.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+105}:\\
\;\;\;\;z\\

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


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

    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 99.9%

      \[\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. *-commutative99.9%

        \[\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. Simplified99.9%

      \[\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. Taylor expanded in z around inf 35.3%

      \[\leadsto \color{blue}{z} \]

    if -1.3000000000000001e105 < 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 a around inf 20.9%

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

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

Alternative 17: 16.3% 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.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 a around inf 19.0%

    \[\leadsto \color{blue}{a} \]
  4. Final simplification19.0%

    \[\leadsto a \]
  5. Add Preprocessing

Reproduce

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