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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -5.7 \cdot 10^{+125}:\\ \;\;\;\;a + \left(t + \left(z + \left(t\_1 + y \cdot i\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.38 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(t\_1 + b \cdot \log c\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -5.7e+125)
     (+ a (+ t (+ z (+ t_1 (* y i)))))
     (if (<= x 1.38e+104)
       (fma y i (+ a (+ t (+ z (* (log c) (- b 0.5))))))
       (+ a (+ t (+ z (+ t_1 (* b (log c))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -5.7e+125) {
		tmp = a + (t + (z + (t_1 + (y * i))));
	} else if (x <= 1.38e+104) {
		tmp = fma(y, i, (a + (t + (z + (log(c) * (b - 0.5))))));
	} else {
		tmp = a + (t + (z + (t_1 + (b * log(c)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -5.7e+125)
		tmp = Float64(a + Float64(t + Float64(z + Float64(t_1 + Float64(y * i)))));
	elseif (x <= 1.38e+104)
		tmp = fma(y, i, Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))))));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(t_1 + Float64(b * log(c))))));
	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, -5.7e+125], N[(a + N[(t + N[(z + N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.38e+104], N[(y * i + N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(t$95$1 + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

    if -5.6999999999999996e125 < x < 1.38e104

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.38e104 < x

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 3: 93.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -6.2 \cdot 10^{+124}:\\ \;\;\;\;a + \left(t + \left(z + \left(t\_1 + y \cdot i\right)\right)\right)\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+103}:\\ \;\;\;\;\left(z + t\right) + \left(y \cdot i + \mathsf{fma}\left(\log c, b + -0.5, a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(t\_1 + b \cdot \log c\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -6.2e+124)
     (+ a (+ t (+ z (+ t_1 (* y i)))))
     (if (<= x 5.2e+103)
       (+ (+ z t) (+ (* y i) (fma (log c) (+ b -0.5) a)))
       (+ a (+ t (+ z (+ t_1 (* b (log c))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -6.2e+124) {
		tmp = a + (t + (z + (t_1 + (y * i))));
	} else if (x <= 5.2e+103) {
		tmp = (z + t) + ((y * i) + fma(log(c), (b + -0.5), a));
	} else {
		tmp = a + (t + (z + (t_1 + (b * log(c)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -6.2e+124)
		tmp = Float64(a + Float64(t + Float64(z + Float64(t_1 + Float64(y * i)))));
	elseif (x <= 5.2e+103)
		tmp = Float64(Float64(z + t) + Float64(Float64(y * i) + fma(log(c), Float64(b + -0.5), a)));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(t_1 + Float64(b * log(c))))));
	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, -6.2e+124], N[(a + N[(t + N[(z + N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+103], N[(N[(z + t), $MachinePrecision] + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(t$95$1 + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

    if -6.2000000000000004e124 < x < 5.2000000000000003e103

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000003e103 < x

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 4: 93.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

    if -1.26000000000000004e126 < x < 2.69999999999999985e104

    1. Initial program 99.9%

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

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

    if 2.69999999999999985e104 < x

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 5: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 6: 98.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 7: 89.1% accurate, 1.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 b #s(literal 1/2 binary64)) < -5.0000000000000001e114

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000001e114 < (-.f64 b #s(literal 1/2 binary64)) < 4.0000000000000002e235

    1. Initial program 99.9%

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

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

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

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

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

    if 4.0000000000000002e235 < (-.f64 b #s(literal 1/2 binary64))

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 94.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+125} \lor \neg \left(x \leq 1.9 \cdot 10^{+72}\right):\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.7999999999999998e125 or 1.90000000000000003e72 < x

    1. Initial program 99.7%

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

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

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

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

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

    if -6.7999999999999998e125 < x < 1.90000000000000003e72

    1. Initial program 99.9%

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

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

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

Alternative 9: 73.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.25 \cdot 10^{+78}:\\
\;\;\;\;\left(z + t\right) + \left(y \cdot i + b \cdot \log c\right)\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.25e78 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.2% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.06e20 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 70.8% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.42e225 or 3.8000000000000001e196 < x

    1. Initial program 99.5%

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

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

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

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

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

    if -1.42e225 < x < 3.8000000000000001e196

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 71.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{+196} \lor \neg \left(b \leq 1.2 \cdot 10^{+259}\right):\\
\;\;\;\;b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.8000000000000002e196 or 1.2e259 < b

    1. Initial program 99.6%

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

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

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

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

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

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

      \[\leadsto i \cdot \color{blue}{\frac{b \cdot \log c}{i}} \]
    7. Step-by-step derivation
      1. associate-*r/53.9%

        \[\leadsto \color{blue}{\frac{i \cdot \left(b \cdot \log c\right)}{i}} \]
      2. *-commutative53.9%

        \[\leadsto \frac{i \cdot \color{blue}{\left(\log c \cdot b\right)}}{i} \]
    8. Applied egg-rr53.9%

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

        \[\leadsto \color{blue}{i \cdot \frac{\log c \cdot b}{i}} \]
      2. *-commutative31.8%

        \[\leadsto i \cdot \frac{\color{blue}{b \cdot \log c}}{i} \]
      3. associate-*r/31.7%

        \[\leadsto i \cdot \color{blue}{\left(b \cdot \frac{\log c}{i}\right)} \]
      4. associate-*r*54.0%

        \[\leadsto \color{blue}{\left(i \cdot b\right) \cdot \frac{\log c}{i}} \]
    10. Simplified54.0%

      \[\leadsto \color{blue}{\left(i \cdot b\right) \cdot \frac{\log c}{i}} \]
    11. Taylor expanded in i around 0 73.3%

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

    if -2.8000000000000002e196 < b < 1.2e259

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 22.6% accurate, 9.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 5 \cdot 10^{-280}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 3.3 \cdot 10^{-127}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 4.9 \cdot 10^{+45}:\\
\;\;\;\;z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 5.00000000000000028e-280 or 3.29999999999999981e-127 < a < 4.9000000000000002e45

    1. Initial program 99.8%

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

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

    if 5.00000000000000028e-280 < a < 3.29999999999999981e-127 or 4.9000000000000002e45 < a < 8.9999999999999998e112

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified32.6%

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

    if 8.9999999999999998e112 < a

    1. Initial program 99.9%

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

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

Alternative 14: 54.3% accurate, 9.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{+116} \lor \neg \left(a \leq 4 \cdot 10^{+134}\right) \land a \leq 7.8 \cdot 10^{+171}:\\
\;\;\;\;y \cdot i + \left(z + t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.2000000000000002e116 or 3.99999999999999969e134 < a < 7.8e171

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000002e116 < a < 3.99999999999999969e134 or 7.8e171 < a

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.2 \cdot 10^{+116} \lor \neg \left(a \leq 4 \cdot 10^{+134}\right) \land a \leq 7.8 \cdot 10^{+171}:\\ \;\;\;\;y \cdot i + \left(z + t\right)\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 54.1% accurate, 11.5× speedup?

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

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

\mathbf{elif}\;a \leq 2.1 \cdot 10^{+215}:\\
\;\;\;\;\left(z + t\right) + y \cdot \frac{a}{y}\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1499999999999999e108 < a < 2.1000000000000002e215

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1000000000000002e215 < a

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.15 \cdot 10^{+108}:\\ \;\;\;\;y \cdot i + \left(z + t\right)\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+215}:\\ \;\;\;\;\left(z + t\right) + y \cdot \frac{a}{y}\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 66.6% accurate, 24.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 21.3% accurate, 36.4× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

    if 7.0000000000000001e113 < a

    1. Initial program 99.9%

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

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

Alternative 18: 15.6% accurate, 219.0× speedup?

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

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

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

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

Reproduce

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