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

Percentage Accurate: 99.8% → 99.8%
Time: 15.9s
Alternatives: 17
Speedup: 1.0×

Specification

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

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Alternative 1: 99.8% accurate, 0.4× speedup?

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

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.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. 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(y \cdot i + \left(b + -0.5\right) \cdot \log c\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ t a) (fma x (log y) z)) (+ (* y i) (* (+ b -0.5) (log c)))))
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)) + ((y * i) + ((b + -0.5) * log(c)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(t + a) + fma(x, log(y), z)) + Float64(Float64(y * i) + Float64(Float64(b + -0.5) * log(c))))
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[(y * i), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. 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. Final simplification99.9%

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

Alternative 3: 90.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 8.5 \cdot 10^{+212}:\\
\;\;\;\;a + \left(t + \left(z + \left(t\_1 + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\

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


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

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

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

    if 2.80000000000000001e158 < a < 8.49999999999999979e212

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

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

    if 8.49999999999999979e212 < 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. fma-define100.0%

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

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

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

      \[\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 x around 0 100.0%

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

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

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

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

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

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

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

Alternative 4: 88.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.28 \cdot 10^{+231} \lor \neg \left(x \leq 1.3 \cdot 10^{+187}\right):\\ \;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(z + \left(t + a\right)\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -1.28e+231) (not (<= x 1.3e+187)))
   (* x (+ (log y) (/ z x)))
   (fma y i (+ (+ z (+ t a)) (* (+ b -0.5) (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -1.28e+231) || !(x <= 1.3e+187)) {
		tmp = x * (log(y) + (z / x));
	} else {
		tmp = fma(y, i, ((z + (t + a)) + ((b + -0.5) * log(c))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -1.28e+231) || !(x <= 1.3e+187))
		tmp = Float64(x * Float64(log(y) + Float64(z / x)));
	else
		tmp = fma(y, i, Float64(Float64(z + Float64(t + a)) + Float64(Float64(b + -0.5) * log(c))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.28e+231], N[Not[LessEqual[x, 1.3e+187]], $MachinePrecision]], N[(x * N[(N[Log[y], $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.28 \cdot 10^{+231} \lor \neg \left(x \leq 1.3 \cdot 10^{+187}\right):\\
\;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.28e231 or 1.2999999999999999e187 < 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.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 inf 99.8%

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

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

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

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

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

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

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

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

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

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

    if -1.28e231 < x < 1.2999999999999999e187

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.28 \cdot 10^{+231} \lor \neg \left(x \leq 1.3 \cdot 10^{+187}\right):\\ \;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(z + \left(t + a\right)\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.75 \cdot 10^{+22}:\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(z + \left(t + a\right)\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y 1.75e+22)
   (+ a (+ t (+ z (+ (* x (log y)) (* (log c) (- b 0.5))))))
   (fma y i (+ (+ z (+ t a)) (* (+ b -0.5) (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 1.75e+22) {
		tmp = a + (t + (z + ((x * log(y)) + (log(c) * (b - 0.5)))));
	} else {
		tmp = fma(y, i, ((z + (t + a)) + ((b + -0.5) * log(c))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= 1.75e+22)
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + Float64(log(c) * Float64(b - 0.5))))));
	else
		tmp = fma(y, i, Float64(Float64(z + Float64(t + a)) + Float64(Float64(b + -0.5) * log(c))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.75e+22], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75 \cdot 10^{+22}:\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\

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


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

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

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

    if 1.75e22 < y

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.8% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Add Preprocessing
  3. Final simplification99.9%

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

Alternative 7: 88.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+230} \lor \neg \left(x \leq 2.4 \cdot 10^{+188}\right):\\ \;\;\;\;x \cdot \left(\log y + \frac{z}{x}\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 -5.6e+230) (not (<= x 2.4e+188)))
   (* x (+ (log y) (/ z x)))
   (+ 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 <= -5.6e+230) || !(x <= 2.4e+188)) {
		tmp = x * (log(y) + (z / x));
	} 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 <= (-5.6d+230)) .or. (.not. (x <= 2.4d+188))) then
        tmp = x * (log(y) + (z / x))
    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 <= -5.6e+230) || !(x <= 2.4e+188)) {
		tmp = x * (Math.log(y) + (z / x));
	} 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 <= -5.6e+230) or not (x <= 2.4e+188):
		tmp = x * (math.log(y) + (z / x))
	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 <= -5.6e+230) || !(x <= 2.4e+188))
		tmp = Float64(x * Float64(log(y) + Float64(z / x)));
	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 <= -5.6e+230) || ~((x <= 2.4e+188)))
		tmp = x * (log(y) + (z / x));
	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, -5.6e+230], N[Not[LessEqual[x, 2.4e+188]], $MachinePrecision]], N[(x * N[(N[Log[y], $MachinePrecision] + N[(z / x), $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 -5.6 \cdot 10^{+230} \lor \neg \left(x \leq 2.4 \cdot 10^{+188}\right):\\
\;\;\;\;x \cdot \left(\log y + \frac{z}{x}\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 < -5.6000000000000004e230 or 2.3999999999999999e188 < 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.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 inf 99.8%

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

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

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

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

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

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

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

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

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

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

    if -5.6000000000000004e230 < x < 2.3999999999999999e188

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+230} \lor \neg \left(x \leq 2.4 \cdot 10^{+188}\right):\\ \;\;\;\;x \cdot \left(\log y + \frac{z}{x}\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: 86.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+231} \lor \neg \left(x \leq 1.06 \cdot 10^{+188}\right):\\
\;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.2999999999999999e231 or 1.06000000000000007e188 < 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.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 inf 99.8%

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

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

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

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

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

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

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

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

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

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

    if -1.2999999999999999e231 < x < 1.06000000000000007e188

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

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

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

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

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

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

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

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

Alternative 9: 73.2% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.0999999999999999e230 or 2.3999999999999999e188 < 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.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 inf 99.8%

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

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

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

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

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

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

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

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

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

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

    if -6.0999999999999999e230 < x < 2.3999999999999999e188

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

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

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

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

      \[\leadsto \left(\left(a + t\right) + z\right) + \color{blue}{i \cdot \left(y + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)} \]
    9. Step-by-step derivation
      1. sub-neg77.1%

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

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

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

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

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

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

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

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

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

Alternative 10: 58.9% accurate, 1.9× speedup?

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

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

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


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

    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 z around inf 81.4%

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

    if -8.79999999999999967e110 < z

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 54.8%

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

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

Alternative 11: 60.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+142}:\\
\;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\

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


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

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

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

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

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

      \[\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 x around 0 91.1%

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

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

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

      \[\leadsto \left(\left(a + t\right) + z\right) + \color{blue}{i \cdot \left(y + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)} \]
    9. Step-by-step derivation
      1. sub-neg79.9%

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

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

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

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

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

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

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

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

    if -1.15000000000000001e142 < z

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 55.7%

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

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

Alternative 12: 66.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3 \cdot 10^{+20}:\\ \;\;\;\;a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y 3e+20) (+ a (+ z (* (log c) (- b 0.5)))) (+ (* y i) (+ z (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 3e+20) {
		tmp = a + (z + (log(c) * (b - 0.5)));
	} else {
		tmp = (y * i) + (z + (t + a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= 3d+20) then
        tmp = a + (z + (log(c) * (b - 0.5d0)))
    else
        tmp = (y * i) + (z + (t + a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 3e+20) {
		tmp = a + (z + (Math.log(c) * (b - 0.5)));
	} else {
		tmp = (y * i) + (z + (t + a));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= 3e+20:
		tmp = a + (z + (math.log(c) * (b - 0.5)))
	else:
		tmp = (y * i) + (z + (t + a))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= 3e+20)
		tmp = Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5))));
	else
		tmp = Float64(Float64(y * i) + Float64(z + Float64(t + a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= 3e+20)
		tmp = a + (z + (log(c) * (b - 0.5)));
	else
		tmp = (y * i) + (z + (t + a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 3e+20], N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{+20}:\\
\;\;\;\;a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\

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


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

    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 x around 0 78.0%

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

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

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

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

        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \log c \cdot \left(b - 0.5\right)\right)} \]
      2. sub-neg74.3%

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

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

        \[\leadsto \left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right) \]
    10. Simplified74.3%

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

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

    if 3e20 < y

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 x around 0 89.1%

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

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

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

      \[\leadsto \left(\left(a + t\right) + z\right) + \color{blue}{i \cdot \left(y + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)} \]
    9. Step-by-step derivation
      1. sub-neg79.0%

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

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

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

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

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

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

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

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

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

Alternative 13: 72.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+232} \lor \neg \left(x \leq 1.7 \cdot 10^{+225}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.0199999999999999e232 or 1.70000000000000009e225 < 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.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 inf 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.0199999999999999e232 < x < 1.70000000000000009e225

    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 x around 0 90.5%

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

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

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

      \[\leadsto \left(\left(a + t\right) + z\right) + \color{blue}{i \cdot \left(y + \frac{\log c \cdot \left(b - 0.5\right)}{i}\right)} \]
    9. Step-by-step derivation
      1. sub-neg75.8%

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

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

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

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

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

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

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

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

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

Alternative 14: 22.6% accurate, 16.8× speedup?

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

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

\mathbf{elif}\;z \leq -9.4 \cdot 10^{-101}:\\
\;\;\;\;y \cdot i\\

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


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

    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 inf 69.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+69.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+69.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. *-commutative69.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-neg69.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-eval69.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*69.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. +-commutative69.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. Simplified69.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 41.1%

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} \]
    10. Taylor expanded in x around 0 52.4%

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

    if -3.25e100 < z < -9.3999999999999999e-101

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified31.3%

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

    if -9.3999999999999999e-101 < z

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 x around 0 80.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \log c \cdot \left(b - 0.5\right)\right)} \]
      2. sub-neg58.4%

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

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

        \[\leadsto \left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right) \]
    10. Simplified58.4%

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

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

Alternative 15: 68.2% accurate, 24.3× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. 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 x around 0 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 20.9% accurate, 36.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+96}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -4.2e+96) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -4.2e+96) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (z <= (-4.2d+96)) then
        tmp = z
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -4.2e+96) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -4.2e+96:
		tmp = z
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -4.2e+96)
		tmp = z;
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -4.2e+96)
		tmp = z;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -4.2e+96], z, a]
\begin{array}{l}

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

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


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

    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 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.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) + \color{blue}{\log c \cdot \frac{b + -0.5}{x}}\right)\right)\right) \]
      7. +-commutative68.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) + \log c \cdot \frac{\color{blue}{-0.5 + b}}{x}\right)\right)\right) \]
    7. Simplified68.0%

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} \]
    10. Taylor expanded in x around 0 51.2%

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

    if -4.2000000000000002e96 < z

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 x around 0 81.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \log c \cdot \left(b - 0.5\right)\right)} \]
      2. sub-neg58.3%

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

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

        \[\leadsto \left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right) \]
    10. Simplified58.3%

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

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

Alternative 17: 16.0% accurate, 219.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
def code(x, y, z, t, a, b, c, i):
	return a
function code(x, y, z, t, a, b, c, i)
	return a
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. 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 x around 0 83.2%

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

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

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

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

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

      \[\leadsto \left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) \]
    3. metadata-eval62.2%

      \[\leadsto \left(a + t\right) + \left(z + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right) \]
    4. +-commutative62.2%

      \[\leadsto \left(a + t\right) + \left(z + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right) \]
  10. Simplified62.2%

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

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

Reproduce

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