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

Percentage Accurate: 99.8% → 99.8%
Time: 23.9s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.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. +-commutative99.9%

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. 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) \]
    9. 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. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left(\color{blue}{\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) \]
  5. Applied egg-rr99.8%

    \[\leadsto \left(\color{blue}{\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) \]
  6. Step-by-step derivation
    1. +-commutative99.8%

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

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

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

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

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

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

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

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

Alternative 3: 91.2% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(z + \mathsf{fma}\left(y, i, t_1\right)\right) + \left(t + a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -0.00175000000000000004

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

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

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

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

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

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

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

    if -0.00175000000000000004 < i < 2.35000000000000009

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 96.8%

      \[\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 2.35000000000000009 < i

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -0.00175:\\ \;\;\;\;y \cdot i + \left(a + \left(\left(z + t\right) + \log c \cdot \left(b + -0.5\right)\right)\right)\\ \mathbf{elif}\;i \leq 2.35:\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + \left(b - 0.5\right) \cdot \log c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z + \mathsf{fma}\left(y, i, \log c \cdot \left(b + -0.5\right)\right)\right) + \left(t + a\right)\\ \end{array} \]

Alternative 4: 99.8% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.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. +-commutative99.9%

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. 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) \]
    9. 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. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left(\color{blue}{\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) \]
  5. Applied egg-rr99.8%

    \[\leadsto \left(\color{blue}{\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) \]
  6. Final simplification99.8%

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

Alternative 5: 90.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 4.4 \cdot 10^{+215}:\\
\;\;\;\;y \cdot i + \left(\left(t + a\right) + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 88.0%

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

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

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

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

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

    if -1.40000000000000006e180 < x < 4.4000000000000003e215

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4000000000000003e215 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around inf 96.6%

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+180}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+215}:\\ \;\;\;\;y \cdot i + \left(\left(t + a\right) + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]

Alternative 6: 84.2% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Taylor expanded in t around 0 82.7%

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

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

Alternative 7: 90.6% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 88.0%

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

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

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

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

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

    if -8.20000000000000035e181 < x < 9.9999999999999996e210

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

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

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

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

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

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

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

    if 9.9999999999999996e210 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around inf 96.6%

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{+181}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 10^{+211}:\\ \;\;\;\;y \cdot i + \left(a + \left(\left(z + t\right) + \log c \cdot \left(b + -0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]

Alternative 8: 58.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t_1 + y \cdot i\\ t_3 := a + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{if}\;x \leq -7.2 \cdot 10^{+130}:\\ \;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+99}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+118}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5 \cdot 10^{+165}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+208}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y)))
        (t_2 (+ t_1 (* y i)))
        (t_3 (+ a (+ z (* (- b 0.5) (log c))))))
   (if (<= x -7.2e+130)
     (+ a (+ t (+ z t_1)))
     (if (<= x 4e+99)
       t_3
       (if (<= x 3.8e+118)
         t_2
         (if (<= x 5e+165) t_3 (if (<= x 1.15e+208) (+ a (* y i)) t_2)))))))
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 t_2 = t_1 + (y * i);
	double t_3 = a + (z + ((b - 0.5) * log(c)));
	double tmp;
	if (x <= -7.2e+130) {
		tmp = a + (t + (z + t_1));
	} else if (x <= 4e+99) {
		tmp = t_3;
	} else if (x <= 3.8e+118) {
		tmp = t_2;
	} else if (x <= 5e+165) {
		tmp = t_3;
	} else if (x <= 1.15e+208) {
		tmp = a + (y * i);
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 + (y * i)
    t_3 = a + (z + ((b - 0.5d0) * log(c)))
    if (x <= (-7.2d+130)) then
        tmp = a + (t + (z + t_1))
    else if (x <= 4d+99) then
        tmp = t_3
    else if (x <= 3.8d+118) then
        tmp = t_2
    else if (x <= 5d+165) then
        tmp = t_3
    else if (x <= 1.15d+208) then
        tmp = a + (y * i)
    else
        tmp = t_2
    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 t_2 = t_1 + (y * i);
	double t_3 = a + (z + ((b - 0.5) * Math.log(c)));
	double tmp;
	if (x <= -7.2e+130) {
		tmp = a + (t + (z + t_1));
	} else if (x <= 4e+99) {
		tmp = t_3;
	} else if (x <= 3.8e+118) {
		tmp = t_2;
	} else if (x <= 5e+165) {
		tmp = t_3;
	} else if (x <= 1.15e+208) {
		tmp = a + (y * i);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	t_2 = t_1 + (y * i)
	t_3 = a + (z + ((b - 0.5) * math.log(c)))
	tmp = 0
	if x <= -7.2e+130:
		tmp = a + (t + (z + t_1))
	elif x <= 4e+99:
		tmp = t_3
	elif x <= 3.8e+118:
		tmp = t_2
	elif x <= 5e+165:
		tmp = t_3
	elif x <= 1.15e+208:
		tmp = a + (y * i)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	t_2 = Float64(t_1 + Float64(y * i))
	t_3 = Float64(a + Float64(z + Float64(Float64(b - 0.5) * log(c))))
	tmp = 0.0
	if (x <= -7.2e+130)
		tmp = Float64(a + Float64(t + Float64(z + t_1)));
	elseif (x <= 4e+99)
		tmp = t_3;
	elseif (x <= 3.8e+118)
		tmp = t_2;
	elseif (x <= 5e+165)
		tmp = t_3;
	elseif (x <= 1.15e+208)
		tmp = Float64(a + Float64(y * i));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = x * log(y);
	t_2 = t_1 + (y * i);
	t_3 = a + (z + ((b - 0.5) * log(c)));
	tmp = 0.0;
	if (x <= -7.2e+130)
		tmp = a + (t + (z + t_1));
	elseif (x <= 4e+99)
		tmp = t_3;
	elseif (x <= 3.8e+118)
		tmp = t_2;
	elseif (x <= 5e+165)
		tmp = t_3;
	elseif (x <= 1.15e+208)
		tmp = a + (y * i);
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.2e+130], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e+99], t$95$3, If[LessEqual[x, 3.8e+118], t$95$2, If[LessEqual[x, 5e+165], t$95$3, If[LessEqual[x, 1.15e+208], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 4 \cdot 10^{+99}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 3.8 \cdot 10^{+118}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 5 \cdot 10^{+165}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{+208}:\\
\;\;\;\;a + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -7.2000000000000002e130

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 85.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)} \]
    7. Taylor expanded in b around 0 80.5%

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

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

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

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

    if -7.2000000000000002e130 < x < 3.9999999999999999e99 or 3.80000000000000016e118 < x < 4.9999999999999997e165

    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. +-commutative99.9%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.9%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 79.6%

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

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

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

    if 3.9999999999999999e99 < x < 3.80000000000000016e118 or 1.15e208 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around inf 92.5%

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

    if 4.9999999999999997e165 < x < 1.15e208

    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. Taylor expanded in a around inf 56.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+130}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+99}:\\ \;\;\;\;a + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+118}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{elif}\;x \leq 5 \cdot 10^{+165}:\\ \;\;\;\;a + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+208}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]

Alternative 9: 70.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t_1 + y \cdot i\\ t_3 := z + \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;x \leq -5.8 \cdot 10^{+122}:\\ \;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+99}:\\ \;\;\;\;a + \left(t + t_3\right)\\ \mathbf{elif}\;x \leq 6.7 \cdot 10^{+121}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+165}:\\ \;\;\;\;a + t_3\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+208}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y)))
        (t_2 (+ t_1 (* y i)))
        (t_3 (+ z (* (- b 0.5) (log c)))))
   (if (<= x -5.8e+122)
     (+ a (+ t (+ z t_1)))
     (if (<= x 1.5e+99)
       (+ a (+ t t_3))
       (if (<= x 6.7e+121)
         t_2
         (if (<= x 4.3e+165)
           (+ a t_3)
           (if (<= x 1.15e+208) (+ a (* y i)) t_2)))))))
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 t_2 = t_1 + (y * i);
	double t_3 = z + ((b - 0.5) * log(c));
	double tmp;
	if (x <= -5.8e+122) {
		tmp = a + (t + (z + t_1));
	} else if (x <= 1.5e+99) {
		tmp = a + (t + t_3);
	} else if (x <= 6.7e+121) {
		tmp = t_2;
	} else if (x <= 4.3e+165) {
		tmp = a + t_3;
	} else if (x <= 1.15e+208) {
		tmp = a + (y * i);
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 + (y * i)
    t_3 = z + ((b - 0.5d0) * log(c))
    if (x <= (-5.8d+122)) then
        tmp = a + (t + (z + t_1))
    else if (x <= 1.5d+99) then
        tmp = a + (t + t_3)
    else if (x <= 6.7d+121) then
        tmp = t_2
    else if (x <= 4.3d+165) then
        tmp = a + t_3
    else if (x <= 1.15d+208) then
        tmp = a + (y * i)
    else
        tmp = t_2
    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 t_2 = t_1 + (y * i);
	double t_3 = z + ((b - 0.5) * Math.log(c));
	double tmp;
	if (x <= -5.8e+122) {
		tmp = a + (t + (z + t_1));
	} else if (x <= 1.5e+99) {
		tmp = a + (t + t_3);
	} else if (x <= 6.7e+121) {
		tmp = t_2;
	} else if (x <= 4.3e+165) {
		tmp = a + t_3;
	} else if (x <= 1.15e+208) {
		tmp = a + (y * i);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	t_2 = t_1 + (y * i)
	t_3 = z + ((b - 0.5) * math.log(c))
	tmp = 0
	if x <= -5.8e+122:
		tmp = a + (t + (z + t_1))
	elif x <= 1.5e+99:
		tmp = a + (t + t_3)
	elif x <= 6.7e+121:
		tmp = t_2
	elif x <= 4.3e+165:
		tmp = a + t_3
	elif x <= 1.15e+208:
		tmp = a + (y * i)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	t_2 = Float64(t_1 + Float64(y * i))
	t_3 = Float64(z + Float64(Float64(b - 0.5) * log(c)))
	tmp = 0.0
	if (x <= -5.8e+122)
		tmp = Float64(a + Float64(t + Float64(z + t_1)));
	elseif (x <= 1.5e+99)
		tmp = Float64(a + Float64(t + t_3));
	elseif (x <= 6.7e+121)
		tmp = t_2;
	elseif (x <= 4.3e+165)
		tmp = Float64(a + t_3);
	elseif (x <= 1.15e+208)
		tmp = Float64(a + Float64(y * i));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = x * log(y);
	t_2 = t_1 + (y * i);
	t_3 = z + ((b - 0.5) * log(c));
	tmp = 0.0;
	if (x <= -5.8e+122)
		tmp = a + (t + (z + t_1));
	elseif (x <= 1.5e+99)
		tmp = a + (t + t_3);
	elseif (x <= 6.7e+121)
		tmp = t_2;
	elseif (x <= 4.3e+165)
		tmp = a + t_3;
	elseif (x <= 1.15e+208)
		tmp = a + (y * i);
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e+122], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+99], N[(a + N[(t + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.7e+121], t$95$2, If[LessEqual[x, 4.3e+165], N[(a + t$95$3), $MachinePrecision], If[LessEqual[x, 1.15e+208], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+99}:\\
\;\;\;\;a + \left(t + t_3\right)\\

\mathbf{elif}\;x \leq 6.7 \cdot 10^{+121}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 4.3 \cdot 10^{+165}:\\
\;\;\;\;a + t_3\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{+208}:\\
\;\;\;\;a + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -5.8000000000000002e122

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 85.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)} \]
    7. Taylor expanded in b around 0 80.5%

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

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

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

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

    if -5.8000000000000002e122 < x < 1.50000000000000007e99

    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. +-commutative99.9%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.9%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 79.6%

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

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

    if 1.50000000000000007e99 < x < 6.6999999999999999e121 or 1.15e208 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around inf 92.5%

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

    if 6.6999999999999999e121 < x < 4.3e165

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 79.3%

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

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

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

    if 4.3e165 < x < 1.15e208

    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. Taylor expanded in a around inf 56.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+122}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+99}:\\ \;\;\;\;a + \left(t + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\\ \mathbf{elif}\;x \leq 6.7 \cdot 10^{+121}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+165}:\\ \;\;\;\;a + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+208}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]

Alternative 10: 76.5% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 88.0%

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

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

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

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

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

    if -1.22e181 < x < 4.5000000000000002e212

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000002e212 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around inf 96.6%

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.22 \cdot 10^{+181}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+212}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]

Alternative 11: 66.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;i \leq -5 \cdot 10^{+167}:\\ \;\;\;\;t_1 + y \cdot i\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{+131}:\\ \;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= i -5e+167)
     (+ t_1 (* y i))
     (if (<= i 7.6e+131) (+ a (+ t (+ z t_1))) (+ z (* y i))))))
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 (i <= -5e+167) {
		tmp = t_1 + (y * i);
	} else if (i <= 7.6e+131) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = z + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * log(y)
    if (i <= (-5d+167)) then
        tmp = t_1 + (y * i)
    else if (i <= 7.6d+131) then
        tmp = a + (t + (z + t_1))
    else
        tmp = z + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * Math.log(y);
	double tmp;
	if (i <= -5e+167) {
		tmp = t_1 + (y * i);
	} else if (i <= 7.6e+131) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = z + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	tmp = 0
	if i <= -5e+167:
		tmp = t_1 + (y * i)
	elif i <= 7.6e+131:
		tmp = a + (t + (z + t_1))
	else:
		tmp = z + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (i <= -5e+167)
		tmp = Float64(t_1 + Float64(y * i));
	elseif (i <= 7.6e+131)
		tmp = Float64(a + Float64(t + Float64(z + t_1)));
	else
		tmp = Float64(z + Float64(y * i));
	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 (i <= -5e+167)
		tmp = t_1 + (y * i);
	elseif (i <= 7.6e+131)
		tmp = a + (t + (z + t_1));
	else
		tmp = z + (y * i);
	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[i, -5e+167], N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.6e+131], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;i \leq -5 \cdot 10^{+167}:\\
\;\;\;\;t_1 + y \cdot i\\

\mathbf{elif}\;i \leq 7.6 \cdot 10^{+131}:\\
\;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -4.9999999999999997e167

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

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

    if -4.9999999999999997e167 < i < 7.6000000000000007e131

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 90.3%

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

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

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

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

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

    if 7.6000000000000007e131 < i

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

      \[\leadsto \color{blue}{z} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5 \cdot 10^{+167}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{+131}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z + y \cdot i\\ \end{array} \]

Alternative 12: 42.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;a \leq 7 \cdot 10^{-127}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+99}:\\ \;\;\;\;t_1 + y \cdot i\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{+120}:\\ \;\;\;\;a + \left(z + t\right)\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+126}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= a 7e-127)
     (+ z (* y i))
     (if (<= a 9e+99)
       (+ t_1 (* y i))
       (if (<= a 3.9e+120)
         (+ a (+ z t))
         (if (<= a 2.1e+126) t_1 (+ a (* y i))))))))
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 <= 7e-127) {
		tmp = z + (y * i);
	} else if (a <= 9e+99) {
		tmp = t_1 + (y * i);
	} else if (a <= 3.9e+120) {
		tmp = a + (z + t);
	} else if (a <= 2.1e+126) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * log(y)
    if (a <= 7d-127) then
        tmp = z + (y * i)
    else if (a <= 9d+99) then
        tmp = t_1 + (y * i)
    else if (a <= 3.9d+120) then
        tmp = a + (z + t)
    else if (a <= 2.1d+126) then
        tmp = t_1
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * Math.log(y);
	double tmp;
	if (a <= 7e-127) {
		tmp = z + (y * i);
	} else if (a <= 9e+99) {
		tmp = t_1 + (y * i);
	} else if (a <= 3.9e+120) {
		tmp = a + (z + t);
	} else if (a <= 2.1e+126) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	tmp = 0
	if a <= 7e-127:
		tmp = z + (y * i)
	elif a <= 9e+99:
		tmp = t_1 + (y * i)
	elif a <= 3.9e+120:
		tmp = a + (z + t)
	elif a <= 2.1e+126:
		tmp = t_1
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (a <= 7e-127)
		tmp = Float64(z + Float64(y * i));
	elseif (a <= 9e+99)
		tmp = Float64(t_1 + Float64(y * i));
	elseif (a <= 3.9e+120)
		tmp = Float64(a + Float64(z + t));
	elseif (a <= 2.1e+126)
		tmp = t_1;
	else
		tmp = Float64(a + Float64(y * i));
	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 <= 7e-127)
		tmp = z + (y * i);
	elseif (a <= 9e+99)
		tmp = t_1 + (y * i);
	elseif (a <= 3.9e+120)
		tmp = a + (z + t);
	elseif (a <= 2.1e+126)
		tmp = t_1;
	else
		tmp = a + (y * i);
	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, 7e-127], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+99], N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.9e+120], N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.1e+126], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;a \leq 7 \cdot 10^{-127}:\\
\;\;\;\;z + y \cdot i\\

\mathbf{elif}\;a \leq 9 \cdot 10^{+99}:\\
\;\;\;\;t_1 + y \cdot i\\

\mathbf{elif}\;a \leq 3.9 \cdot 10^{+120}:\\
\;\;\;\;a + \left(z + t\right)\\

\mathbf{elif}\;a \leq 2.1 \cdot 10^{+126}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < 6.99999999999999979e-127

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

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

    if 6.99999999999999979e-127 < a < 8.9999999999999999e99

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around inf 44.7%

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

    if 8.9999999999999999e99 < a < 3.8999999999999998e120

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr100.0%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 100.0%

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

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

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

    if 3.8999999999999998e120 < a < 2.0999999999999999e126

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def100.0%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr100.0%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in x around inf 50.2%

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

    if 2.0999999999999999e126 < a

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in a around inf 57.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 7 \cdot 10^{-127}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{+120}:\\ \;\;\;\;a + \left(z + t\right)\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+126}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 13: 39.3% accurate, 19.5× speedup?

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

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

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+138} \lor \neg \left(z \leq -1.35 \cdot 10^{+116}\right):\\
\;\;\;\;a + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e190 or -3.2000000000000001e138 < z < -1.35e116

    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. +-commutative99.9%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.9%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in z around inf 50.7%

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

    if -1.7e190 < z < -3.2000000000000001e138 or -1.35e116 < z

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in a around inf 39.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+190}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+138} \lor \neg \left(z \leq -1.35 \cdot 10^{+116}\right):\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 14: 21.0% accurate, 30.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{+28}:\\
\;\;\;\;y \cdot i\\

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


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

    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. +-commutative99.9%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.9%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in z around inf 41.5%

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

    if -1.25e112 < z < -1.14999999999999992e28

    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. Taylor expanded in y around inf 38.4%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    4. Simplified38.4%

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

    if -1.14999999999999992e28 < z

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in a around inf 17.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+112}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+28}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 15: 42.4% accurate, 31.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+113}:\\
\;\;\;\;a + \left(z + t\right)\\

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


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

    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. +-commutative99.9%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.9%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.9%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in y around 0 89.2%

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

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

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

    if -1.19999999999999992e113 < z

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in a around inf 38.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+113}:\\ \;\;\;\;a + \left(z + t\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 16: 42.4% accurate, 31.0× speedup?

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

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

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


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

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

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

    if 1.85000000000000002e112 < a

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in a around inf 55.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.85 \cdot 10^{+112}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 17: 20.5% accurate, 71.5× speedup?

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

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

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


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

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in z around inf 37.9%

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

    if -2.40000000000000004e89 < z

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. 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) \]
      9. 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. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \left(\color{blue}{\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) \]
    5. Applied egg-rr99.8%

      \[\leadsto \left(\color{blue}{\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) \]
    6. Taylor expanded in a around inf 16.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+89}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 18: 16.1% accurate, 219.0× speedup?

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

\\
a
\end{array}
Derivation
  1. Initial program 99.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. +-commutative99.9%

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \color{blue}{\left(t + a\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. 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) \]
    9. 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. Step-by-step derivation
    1. fma-def99.8%

      \[\leadsto \left(\color{blue}{\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) \]
  5. Applied egg-rr99.8%

    \[\leadsto \left(\color{blue}{\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) \]
  6. Taylor expanded in a around inf 16.5%

    \[\leadsto \color{blue}{a} \]
  7. Final simplification16.5%

    \[\leadsto a \]

Reproduce

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