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

Percentage Accurate: 99.8% → 99.8%
Time: 26.0s
Alternatives: 21
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 21 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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ t_2 := y \cdot i + \left(x \cdot \log y + t\_1\right)\\ \mathbf{if}\;x \leq -1.02 \cdot 10^{+228}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3.25 \cdot 10^{+142}:\\ \;\;\;\;y \cdot i + \left(t\_1 + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.92 \cdot 10^{+177} \lor \neg \left(x \leq 1.3 \cdot 10^{+246}\right):\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))) (t_2 (+ (* y i) (+ (* x (log y)) t_1))))
   (if (<= x -1.02e+228)
     t_2
     (if (<= x 3.25e+142)
       (+ (* y i) (+ t_1 (+ a (+ z t))))
       (if (or (<= x 1.92e+177) (not (<= x 1.3e+246)))
         t_2
         (+ (* y i) (+ (+ z a) (* (+ b -0.5) (log c)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = log(c) * (b - 0.5);
	double t_2 = (y * i) + ((x * log(y)) + t_1);
	double tmp;
	if (x <= -1.02e+228) {
		tmp = t_2;
	} else if (x <= 3.25e+142) {
		tmp = (y * i) + (t_1 + (a + (z + t)));
	} else if ((x <= 1.92e+177) || !(x <= 1.3e+246)) {
		tmp = t_2;
	} else {
		tmp = (y * i) + ((z + a) + ((b + -0.5) * log(c)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    t_2 = (y * i) + ((x * log(y)) + t_1)
    if (x <= (-1.02d+228)) then
        tmp = t_2
    else if (x <= 3.25d+142) then
        tmp = (y * i) + (t_1 + (a + (z + t)))
    else if ((x <= 1.92d+177) .or. (.not. (x <= 1.3d+246))) then
        tmp = t_2
    else
        tmp = (y * i) + ((z + a) + ((b + (-0.5d0)) * log(c)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = Math.log(c) * (b - 0.5);
	double t_2 = (y * i) + ((x * Math.log(y)) + t_1);
	double tmp;
	if (x <= -1.02e+228) {
		tmp = t_2;
	} else if (x <= 3.25e+142) {
		tmp = (y * i) + (t_1 + (a + (z + t)));
	} else if ((x <= 1.92e+177) || !(x <= 1.3e+246)) {
		tmp = t_2;
	} else {
		tmp = (y * i) + ((z + a) + ((b + -0.5) * Math.log(c)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	t_2 = (y * i) + ((x * math.log(y)) + t_1)
	tmp = 0
	if x <= -1.02e+228:
		tmp = t_2
	elif x <= 3.25e+142:
		tmp = (y * i) + (t_1 + (a + (z + t)))
	elif (x <= 1.92e+177) or not (x <= 1.3e+246):
		tmp = t_2
	else:
		tmp = (y * i) + ((z + a) + ((b + -0.5) * math.log(c)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	t_2 = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + t_1))
	tmp = 0.0
	if (x <= -1.02e+228)
		tmp = t_2;
	elseif (x <= 3.25e+142)
		tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(z + t))));
	elseif ((x <= 1.92e+177) || !(x <= 1.3e+246))
		tmp = t_2;
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(Float64(b + -0.5) * log(c))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	t_2 = (y * i) + ((x * log(y)) + t_1);
	tmp = 0.0;
	if (x <= -1.02e+228)
		tmp = t_2;
	elseif (x <= 3.25e+142)
		tmp = (y * i) + (t_1 + (a + (z + t)));
	elseif ((x <= 1.92e+177) || ~((x <= 1.3e+246)))
		tmp = t_2;
	else
		tmp = (y * i) + ((z + a) + ((b + -0.5) * log(c)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e+228], t$95$2, If[LessEqual[x, 3.25e+142], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.92e+177], N[Not[LessEqual[x, 1.3e+246]], $MachinePrecision]], t$95$2, N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := y \cdot i + \left(x \cdot \log y + t\_1\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+228}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \leq 1.92 \cdot 10^{+177} \lor \neg \left(x \leq 1.3 \cdot 10^{+246}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.02e228 or 3.2499999999999999e142 < x < 1.9200000000000001e177 or 1.30000000000000007e246 < x

    1. Initial program 97.4%

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{z + \mathsf{fma}\left(x, \log y, t + a\right)}\right)}^{2}} \cdot \sqrt[3]{z + \mathsf{fma}\left(x, \log y, t + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Applied egg-rr96.2%

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

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

    if -1.02e228 < x < 3.2499999999999999e142

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

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

    if 1.9200000000000001e177 < x < 1.30000000000000007e246

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+228}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{elif}\;x \leq 3.25 \cdot 10^{+142}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.92 \cdot 10^{+177} \lor \neg \left(x \leq 1.3 \cdot 10^{+246}\right):\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := x \cdot \log y + t\_1\\
t_3 := y \cdot i + t\_2\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{+227}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{+177}:\\
\;\;\;\;a + \left(t + \left(z + t\_2\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -8.19999999999999992e227 or 5.20000000000000028e246 < x

    1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

    if -8.19999999999999992e227 < x < 5.19999999999999981e95

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

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

    if 5.19999999999999981e95 < x < 2.2999999999999999e177

    1. Initial program 99.8%

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

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

    if 2.2999999999999999e177 < x < 5.20000000000000028e246

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

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

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

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

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

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

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

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

Alternative 4: 91.9% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999961e209 < b < 4.8000000000000003e160

    1. Initial program 99.4%

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

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

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

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

    if 4.8000000000000003e160 < 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 x around 0 91.4%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 6: 62.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;b - 0.5 \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;b - 0.5 \leq -5 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b - 0.5 \leq -100000:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;b - 0.5 \leq -0.5:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b - 0.5 \leq 5 \cdot 10^{+173}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;b - 0.5 \leq 3 \cdot 10^{+208}:\\
\;\;\;\;a + \left(z + t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 b #s(literal 1/2 binary64)) < -9.9999999999999991e211 or 2.99999999999999995e208 < (-.f64 b #s(literal 1/2 binary64))

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

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

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
    5. Step-by-step derivation
      1. *-commutative86.2%

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Simplified86.2%

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

    if -9.9999999999999991e211 < (-.f64 b #s(literal 1/2 binary64)) < -9.99999999999999983e156 or -5e51 < (-.f64 b #s(literal 1/2 binary64)) < -1e5 or -0.5 < (-.f64 b #s(literal 1/2 binary64)) < 5.00000000000000034e173

    1. Initial program 99.8%

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

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

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

    if -9.99999999999999983e156 < (-.f64 b #s(literal 1/2 binary64)) < -5e51 or -1e5 < (-.f64 b #s(literal 1/2 binary64)) < -0.5

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000034e173 < (-.f64 b #s(literal 1/2 binary64)) < 2.99999999999999995e208

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a + \left(z + b \cdot \log c\right)} \]
    14. Step-by-step derivation
      1. *-commutative75.3%

        \[\leadsto a + \left(z + \color{blue}{\log c \cdot b}\right) \]
    15. Simplified75.3%

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

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

Alternative 7: 62.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;b - 0.5 \leq -5 \cdot 10^{+155}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;b - 0.5 \leq 5 \cdot 10^{+173}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b - 0.5 \leq 3 \cdot 10^{+208}:\\
\;\;\;\;a + \left(z + t\_1\right)\\

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


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

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

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

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
    5. Step-by-step derivation
      1. *-commutative92.0%

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Simplified92.0%

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

    if -9.9999999999999991e211 < (-.f64 b #s(literal 1/2 binary64)) < -4.9999999999999999e155 or -0.5 < (-.f64 b #s(literal 1/2 binary64)) < 5.00000000000000034e173

    1. Initial program 99.8%

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

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

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

    if -4.9999999999999999e155 < (-.f64 b #s(literal 1/2 binary64)) < -0.5

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + z\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    9. Simplified67.1%

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

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

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

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

    if 5.00000000000000034e173 < (-.f64 b #s(literal 1/2 binary64)) < 2.99999999999999995e208

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a + \left(z + b \cdot \log c\right)} \]
    14. Step-by-step derivation
      1. *-commutative75.3%

        \[\leadsto a + \left(z + \color{blue}{\log c \cdot b}\right) \]
    15. Simplified75.3%

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

    if 2.99999999999999995e208 < (-.f64 b #s(literal 1/2 binary64))

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 63.4% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;b - 0.5 \leq -0.499998:\\
\;\;\;\;y \cdot i + \left(z + a\right)\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999991e211 < (-.f64 b #s(literal 1/2 binary64)) < -0.499997999999999998

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z + a\right)} + y \cdot i \]
    12. Simplified63.7%

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

    if -0.499997999999999998 < (-.f64 b #s(literal 1/2 binary64)) < 1e137

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

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

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

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

Alternative 9: 61.4% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+242}:\\
\;\;\;\;y \cdot i + t\_1\\

\mathbf{elif}\;b - 0.5 \leq -2 \cdot 10^{+156} \lor \neg \left(b - 0.5 \leq 2 \cdot 10^{+142}\right):\\
\;\;\;\;a + \left(z + t\_1\right)\\

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


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

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

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

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
    5. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Simplified90.8%

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

    if -5.0000000000000004e242 < (-.f64 b #s(literal 1/2 binary64)) < -2e156 or 2.0000000000000001e142 < (-.f64 b #s(literal 1/2 binary64))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(z + \color{blue}{\log c \cdot b}\right) \]
    15. Simplified65.0%

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

    if -2e156 < (-.f64 b #s(literal 1/2 binary64)) < 2.0000000000000001e142

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 59.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot i + \left(z + a\right)\\
\mathbf{if}\;i \leq -12500000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq 7.6 \cdot 10^{-116}:\\
\;\;\;\;a + \left(z + b \cdot \log c\right)\\

\mathbf{elif}\;i \leq 4.7 \cdot 10^{-85}:\\
\;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.25e10 or 4.70000000000000009e-85 < i

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e10 < i < 7.6000000000000003e-116

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(z + \color{blue}{\log c \cdot b}\right) \]
    15. Simplified58.9%

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

    if 7.6000000000000003e-116 < i < 4.70000000000000009e-85

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{z + \mathsf{fma}\left(x, \log y, t + a\right)}\right)}^{2}} \cdot \sqrt[3]{z + \mathsf{fma}\left(x, \log y, t + a\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Applied egg-rr98.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -12500000000:\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{-116}:\\ \;\;\;\;a + \left(z + b \cdot \log c\right)\\ \mathbf{elif}\;i \leq 4.7 \cdot 10^{-85}:\\ \;\;\;\;x \cdot \left(\log y + \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.0% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4e-31

    1. Initial program 99.8%

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

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

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

    if 4e-31 < y

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 84.8% accurate, 1.9× speedup?

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

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

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

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

Alternative 13: 69.7% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

Alternative 14: 55.4% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq 2 \cdot 10^{+151}:\\
\;\;\;\;y \cdot i + \left(z + a\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot \log c\\


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + z\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    9. Simplified67.1%

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

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

        \[\leadsto \color{blue}{\left(z + a\right)} + y \cdot i \]
    12. Simplified60.7%

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

    if 2.00000000000000003e151 < (-.f64 b #s(literal 1/2 binary64))

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

      \[\leadsto \color{blue}{b \cdot \log c} \]
    4. Step-by-step derivation
      1. *-commutative58.9%

        \[\leadsto \color{blue}{\log c \cdot b} \]
    5. Simplified58.9%

      \[\leadsto \color{blue}{\log c \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.5%

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

Alternative 15: 42.6% accurate, 10.9× speedup?

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

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

\mathbf{elif}\;a \leq 1.36 \cdot 10^{+160} \lor \neg \left(a \leq 4.5 \cdot 10^{+265}\right):\\
\;\;\;\;a + y \cdot i\\

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


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

    1. Initial program 99.4%

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

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

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

    if 3.99999999999999978e34 < a < 1.35999999999999997e160 or 4.49999999999999985e265 < a

    1. Initial program 100.0%

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

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

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

    if 1.35999999999999997e160 < a < 4.49999999999999985e265

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(z + a\right)} + y \cdot i \]
    13. Taylor expanded in y around 0 73.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4 \cdot 10^{+34}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 1.36 \cdot 10^{+160} \lor \neg \left(a \leq 4.5 \cdot 10^{+265}\right):\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;z + a\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 23.2% accurate, 12.1× speedup?

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

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

\mathbf{elif}\;z \leq -2.05 \cdot 10^{+119}:\\
\;\;\;\;a\\

\mathbf{elif}\;z \leq -7 \cdot 10^{-199}:\\
\;\;\;\;y \cdot i\\

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


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

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

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

    if -5.6999999999999999e159 < z < -2.0499999999999999e119 or -6.9999999999999998e-199 < z

    1. Initial program 99.9%

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

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

    if -2.0499999999999999e119 < z < -6.9999999999999998e-199

    1. Initial program 97.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 y around inf 47.7%

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

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

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

Alternative 17: 39.0% accurate, 16.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.7 \cdot 10^{+170} \lor \neg \left(i \leq 1.7 \cdot 10^{-34}\right):\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.7000000000000001e170 or 1.7e-34 < i

    1. Initial program 98.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 53.0%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified53.0%

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

    if -1.7000000000000001e170 < i < 1.7e-34

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(z + a\right)} + y \cdot i \]
    13. Taylor expanded in y around 0 38.2%

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

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

Alternative 18: 42.2% accurate, 21.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+155}:\\
\;\;\;\;z + a\\

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + z\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    9. Simplified70.1%

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

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

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

      \[\leadsto \color{blue}{\left(z + a\right)} + y \cdot i \]
    13. Taylor expanded in y around 0 49.8%

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

    if -4.49999999999999973e155 < z

    1. Initial program 99.4%

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

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

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

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

Alternative 19: 52.8% accurate, 31.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 20.8% accurate, 36.4× speedup?

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

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

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


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

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

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

    if -3.4999999999999999e159 < z

    1. Initial program 99.4%

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

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

Alternative 21: 15.9% 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.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 a around inf 14.0%

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

Reproduce

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