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

Percentage Accurate: 99.8% → 99.8%
Time: 16.9s
Alternatives: 18
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 18 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. associate-+l+99.8%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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) \]
  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. Add Preprocessing

Alternative 2: 99.8% accurate, 0.7× speedup?

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

\\
\left(\left(t + a\right) + \mathsf{fma}\left(x, \log y, z\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\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. associate-+l+99.8%

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

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

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

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

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

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

Alternative 3: 94.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+143}:\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(\left(t + a\right) + t\_1\right)\right)\\

\mathbf{elif}\;x \leq 3.05 \cdot 10^{+78}:\\
\;\;\;\;a + \left(t + \left(z + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.2999999999999999e143

    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 z around 0 96.8%

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

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

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

    if -1.2999999999999999e143 < x < 3.05000000000000006e78

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.05000000000000006e78 < 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 94.2%

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + x \cdot \log y\right)\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. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 5: 98.1% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(b \cdot \log c + \left(a + \left(t + \left(z + x \cdot \log y\right)\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. Add Preprocessing
  3. Taylor expanded in b around inf 97.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. *-commutative97.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. Simplified97.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. Final simplification97.6%

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

Alternative 6: 69.1% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := a + \left(t + \left(z + x \cdot \log y\right)\right)\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.2 \cdot 10^{-252}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+84}:\\
\;\;\;\;a + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.59999999999999986e184 or 1.49999999999999998e84 < 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 92.7%

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

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

    if -9.59999999999999986e184 < x < -1.2000000000000001e-252

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2000000000000001e-252 < x < 1.49999999999999998e84

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 62.3%

      \[\leadsto \color{blue}{a} + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 94.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+142} \lor \neg \left(x \leq 2 \cdot 10^{+77}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.60000000000000003e142 or 1.99999999999999997e77 < 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 92.3%

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

    if -1.60000000000000003e142 < x < 1.99999999999999997e77

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 89.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left(b + -0.5\right) \cdot \log c + y \cdot i\\
\mathbf{if}\;b \leq -5.4 \cdot 10^{+199}:\\
\;\;\;\;a + t\_1\\

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

\mathbf{else}:\\
\;\;\;\;z + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.3999999999999998e199

    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. Step-by-step derivation
      1. associate-+l+99.7%

        \[\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. associate-+l+99.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 81.1%

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

    if -5.3999999999999998e199 < b < 6.99999999999999975e167

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

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

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

      \[\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 94.1%

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

    if 6.99999999999999975e167 < b

    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. associate-+l+99.8%

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

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

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

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

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 76.9%

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

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

Alternative 9: 74.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+188} \lor \neg \left(x \leq 2.3 \cdot 10^{+84}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\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 -6.4e+188) (not (<= x 2.3e+84)))
   (+ a (+ t (+ z (* 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 <= -6.4e+188) || !(x <= 2.3e+84)) {
		tmp = a + (t + (z + (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 <= (-6.4d+188)) .or. (.not. (x <= 2.3d+84))) then
        tmp = a + (t + (z + (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 <= -6.4e+188) || !(x <= 2.3e+84)) {
		tmp = a + (t + (z + (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 <= -6.4e+188) or not (x <= 2.3e+84):
		tmp = a + (t + (z + (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 <= -6.4e+188) || !(x <= 2.3e+84))
		tmp = Float64(a + Float64(t + Float64(z + 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 <= -6.4e+188) || ~((x <= 2.3e+84)))
		tmp = a + (t + (z + (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, -6.4e+188], N[Not[LessEqual[x, 2.3e+84]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $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 -6.4 \cdot 10^{+188} \lor \neg \left(x \leq 2.3 \cdot 10^{+84}\right):\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\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 < -6.39999999999999941e188 or 2.2999999999999999e84 < 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 92.7%

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

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

    if -6.39999999999999941e188 < x < 2.2999999999999999e84

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 71.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.04 \cdot 10^{+186} \lor \neg \left(x \leq 8.5 \cdot 10^{+136}\right):\\ \;\;\;\;z + 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 -1.04e+186) (not (<= x 8.5e+136)))
   (+ z (* 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 <= -1.04e+186) || !(x <= 8.5e+136)) {
		tmp = z + (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 <= (-1.04d+186)) .or. (.not. (x <= 8.5d+136))) then
        tmp = z + (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 <= -1.04e+186) || !(x <= 8.5e+136)) {
		tmp = z + (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 <= -1.04e+186) or not (x <= 8.5e+136):
		tmp = z + (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 <= -1.04e+186) || !(x <= 8.5e+136))
		tmp = Float64(z + 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 <= -1.04e+186) || ~((x <= 8.5e+136)))
		tmp = z + (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, -1.04e+186], N[Not[LessEqual[x, 8.5e+136]], $MachinePrecision]], N[(z + N[(x * N[Log[y], $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.04 \cdot 10^{+186} \lor \neg \left(x \leq 8.5 \cdot 10^{+136}\right):\\
\;\;\;\;z + 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 < -1.04e186 or 8.49999999999999966e136 < 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. Step-by-step derivation
      1. associate-+l+99.7%

        \[\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. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-+r+99.5%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0 68.1%

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

    if -1.04e186 < x < 8.49999999999999966e136

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 71.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+147}:\\
\;\;\;\;y \cdot i + t\_1\\

\mathbf{elif}\;x \leq 6.4 \cdot 10^{+137}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;z + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.4499999999999999e147

    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 b around 0 88.5%

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

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

    if -1.4499999999999999e147 < x < 6.40000000000000038e137

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.40000000000000038e137 < 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. 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. associate-+l+99.8%

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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.8%

        \[\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) \]
    3. Simplified99.8%

      \[\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. 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)} \]
    6. Step-by-step derivation
      1. associate-+r+99.7%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0 68.6%

      \[\leadsto \color{blue}{z + x \cdot \log y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+147}:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+137}:\\ \;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z + x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 71.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+196} \lor \neg \left(x \leq 4.2 \cdot 10^{+208}\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 -1.45e+196) (not (<= x 4.2e+208)))
   (* 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 <= -1.45e+196) || !(x <= 4.2e+208)) {
		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 <= (-1.45d+196)) .or. (.not. (x <= 4.2d+208))) 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 <= -1.45e+196) || !(x <= 4.2e+208)) {
		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 <= -1.45e+196) or not (x <= 4.2e+208):
		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 <= -1.45e+196) || !(x <= 4.2e+208))
		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 <= -1.45e+196) || ~((x <= 4.2e+208)))
		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, -1.45e+196], N[Not[LessEqual[x, 4.2e+208]], $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 -1.45 \cdot 10^{+196} \lor \neg \left(x \leq 4.2 \cdot 10^{+208}\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 < -1.45e196 or 4.1999999999999997e208 < x

    1. Initial program 99.5%

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

        \[\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. associate-+l+99.5%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    3. Simplified99.5%

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

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-+r+99.4%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in z around 0 72.3%

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

    if -1.45e196 < x < 4.1999999999999997e208

    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. Step-by-step derivation
      1. associate-+l+99.9%

        \[\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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 22.2% accurate, 16.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.1 \cdot 10^{+59}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 3.1 \cdot 10^{+122}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 2.09999999999999984e59

    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. associate-+l+99.8%

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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.8%

        \[\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) \]
    3. Simplified99.8%

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

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-+r+75.4%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0 15.6%

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

    if 2.09999999999999984e59 < a < 3.09999999999999999e122

    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. Step-by-step derivation
      1. associate-+l+99.7%

        \[\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. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    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. Taylor expanded in y around inf 34.5%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified34.5%

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

    if 3.09999999999999999e122 < 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. Step-by-step derivation
      1. associate-+l+100.0%

        \[\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. associate-+l+100.0%

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

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

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

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

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

        \[\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+100.0%

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot a\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg49.1%

        \[\leadsto -1 \cdot \color{blue}{\left(-a\right)} \]
    8. Simplified49.1%

      \[\leadsto -1 \cdot \color{blue}{\left(-a\right)} \]
    9. Taylor expanded in a around 0 49.1%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 43.2% accurate, 21.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.2 \cdot 10^{+96}:\\ \;\;\;\;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 (<= a 2.2e+96) (+ 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 (a <= 2.2e+96) {
		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 (a <= 2.2d+96) 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 (a <= 2.2e+96) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 2.2e+96:
		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 (a <= 2.2e+96)
		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 (a <= 2.2e+96)
		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[a, 2.2e+96], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{+96}:\\
\;\;\;\;z + y \cdot i\\

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


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

    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.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. *-commutative97.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. Simplified97.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 81.6%

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

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

    if 2.1999999999999999e96 < a

    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 b around 0 91.9%

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

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

Alternative 15: 40.4% accurate, 21.9× speedup?

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

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

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


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

    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. associate-+l+99.8%

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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.8%

        \[\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) \]
    3. Simplified99.8%

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

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-+r+68.0%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0 52.5%

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

    if -1.10000000000000006e204 < 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 b around inf 97.4%

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

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

      \[\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 82.9%

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

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

Alternative 16: 66.8% 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. 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. associate-+l+99.8%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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) \]
  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. Taylor expanded in x around 0 80.4%

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

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

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

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

Alternative 17: 21.8% accurate, 36.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.5 \cdot 10^{+122}:\\
\;\;\;\;z\\

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


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

    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. associate-+l+99.8%

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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.8%

        \[\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) \]
    3. Simplified99.8%

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

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-+r+75.4%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0 14.9%

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

    if 7.5000000000000002e122 < 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. Step-by-step derivation
      1. associate-+l+100.0%

        \[\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. associate-+l+100.0%

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

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

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

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

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

        \[\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+100.0%

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot a\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg49.1%

        \[\leadsto -1 \cdot \color{blue}{\left(-a\right)} \]
    8. Simplified49.1%

      \[\leadsto -1 \cdot \color{blue}{\left(-a\right)} \]
    9. Taylor expanded in a around 0 49.1%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 16.2% 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. 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. associate-+l+99.8%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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) \]
  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. Taylor expanded in i around -inf 69.9%

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

    \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot a\right)} \]
  7. Step-by-step derivation
    1. mul-1-neg13.2%

      \[\leadsto -1 \cdot \color{blue}{\left(-a\right)} \]
  8. Simplified13.2%

    \[\leadsto -1 \cdot \color{blue}{\left(-a\right)} \]
  9. Taylor expanded in a around 0 13.2%

    \[\leadsto \color{blue}{a} \]
  10. Add Preprocessing

Reproduce

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