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

Percentage Accurate: 99.8% → 99.8%
Time: 17.0s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \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) \]
  6. Add Preprocessing

Alternative 2: 89.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := b \cdot \log c\\ t_3 := y \cdot i + \left(t\_1 + t\_2\right)\\ t_4 := a + \left(z + t\right)\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{+230}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.12 \cdot 10^{+114}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + t\_4\right)\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{+160}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+243}:\\ \;\;\;\;y \cdot i + \left(t\_2 + t\_4\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 (* x (log y)))
        (t_2 (* b (log c)))
        (t_3 (+ (* y i) (+ t_1 t_2)))
        (t_4 (+ a (+ z t))))
   (if (<= x -1.45e+230)
     t_3
     (if (<= x 1.12e+114)
       (+ (* y i) (+ (* (log c) (- b 0.5)) t_4))
       (if (<= x 2.25e+160)
         t_3
         (if (<= x 1.8e+243)
           (+ (* y i) (+ t_2 t_4))
           (+ (* 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 = x * log(y);
	double t_2 = b * log(c);
	double t_3 = (y * i) + (t_1 + t_2);
	double t_4 = a + (z + t);
	double tmp;
	if (x <= -1.45e+230) {
		tmp = t_3;
	} else if (x <= 1.12e+114) {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + t_4);
	} else if (x <= 2.25e+160) {
		tmp = t_3;
	} else if (x <= 1.8e+243) {
		tmp = (y * i) + (t_2 + t_4);
	} 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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = b * log(c)
    t_3 = (y * i) + (t_1 + t_2)
    t_4 = a + (z + t)
    if (x <= (-1.45d+230)) then
        tmp = t_3
    else if (x <= 1.12d+114) then
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + t_4)
    else if (x <= 2.25d+160) then
        tmp = t_3
    else if (x <= 1.8d+243) then
        tmp = (y * i) + (t_2 + t_4)
    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 = x * Math.log(y);
	double t_2 = b * Math.log(c);
	double t_3 = (y * i) + (t_1 + t_2);
	double t_4 = a + (z + t);
	double tmp;
	if (x <= -1.45e+230) {
		tmp = t_3;
	} else if (x <= 1.12e+114) {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + t_4);
	} else if (x <= 2.25e+160) {
		tmp = t_3;
	} else if (x <= 1.8e+243) {
		tmp = (y * i) + (t_2 + t_4);
	} else {
		tmp = (y * i) + (a + t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	t_2 = b * math.log(c)
	t_3 = (y * i) + (t_1 + t_2)
	t_4 = a + (z + t)
	tmp = 0
	if x <= -1.45e+230:
		tmp = t_3
	elif x <= 1.12e+114:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + t_4)
	elif x <= 2.25e+160:
		tmp = t_3
	elif x <= 1.8e+243:
		tmp = (y * i) + (t_2 + t_4)
	else:
		tmp = (y * i) + (a + t_1)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	t_2 = Float64(b * log(c))
	t_3 = Float64(Float64(y * i) + Float64(t_1 + t_2))
	t_4 = Float64(a + Float64(z + t))
	tmp = 0.0
	if (x <= -1.45e+230)
		tmp = t_3;
	elseif (x <= 1.12e+114)
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + t_4));
	elseif (x <= 2.25e+160)
		tmp = t_3;
	elseif (x <= 1.8e+243)
		tmp = Float64(Float64(y * i) + Float64(t_2 + t_4));
	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 = x * log(y);
	t_2 = b * log(c);
	t_3 = (y * i) + (t_1 + t_2);
	t_4 = a + (z + t);
	tmp = 0.0;
	if (x <= -1.45e+230)
		tmp = t_3;
	elseif (x <= 1.12e+114)
		tmp = (y * i) + ((log(c) * (b - 0.5)) + t_4);
	elseif (x <= 2.25e+160)
		tmp = t_3;
	elseif (x <= 1.8e+243)
		tmp = (y * i) + (t_2 + t_4);
	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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+230], t$95$3, If[LessEqual[x, 1.12e+114], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.25e+160], t$95$3, If[LessEqual[x, 1.8e+243], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 2.25 \cdot 10^{+160}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{+243}:\\
\;\;\;\;y \cdot i + \left(t\_2 + t\_4\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.45e230 or 1.11999999999999999e114 < x < 2.2499999999999999e160

    1. Initial program 99.7%

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

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

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

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

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

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

    if -1.45e230 < x < 1.11999999999999999e114

    1. Initial program 99.9%

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

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

    if 2.2499999999999999e160 < x < 1.7999999999999998e243

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

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

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

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

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

    if 1.7999999999999998e243 < x

    1. Initial program 99.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+230}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + b \cdot \log c\right)\\ \mathbf{elif}\;x \leq 1.12 \cdot 10^{+114}:\\ \;\;\;\;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.25 \cdot 10^{+160}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + b \cdot \log c\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+243}:\\ \;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ t_2 := x \cdot \log y\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{+199}:\\ \;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + t\_2\right)\right)\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+103}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + t\_1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(t\_2 + t\_1\right)\right)\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 (* x (log y))))
   (if (<= x -1.2e+199)
     (+ (* y i) (+ (* b (log c)) (+ a t_2)))
     (if (<= x 2.9e+103)
       (fma y i (+ a (+ t (+ z t_1))))
       (+ a (+ t (+ z (+ t_2 t_1))))))))
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);
	double tmp;
	if (x <= -1.2e+199) {
		tmp = (y * i) + ((b * log(c)) + (a + t_2));
	} else if (x <= 2.9e+103) {
		tmp = fma(y, i, (a + (t + (z + t_1))));
	} else {
		tmp = a + (t + (z + (t_2 + t_1)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	t_2 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -1.2e+199)
		tmp = Float64(Float64(y * i) + Float64(Float64(b * log(c)) + Float64(a + t_2)));
	elseif (x <= 2.9e+103)
		tmp = fma(y, i, Float64(a + Float64(t + Float64(z + t_1))));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(t_2 + t_1))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+199], N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+103], N[(y * i + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+103}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + t\_1\right)\right)\right)\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -1.20000000000000007e199 < x < 2.8999999999999998e103

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8999999999999998e103 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 90.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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.5%

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

Alternative 4: 91.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+200} \lor \neg \left(x \leq 3.9 \cdot 10^{+104}\right):\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15000000000000002e200 or 3.90000000000000017e104 < x

    1. Initial program 99.7%

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

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

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

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

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

    if -1.15000000000000002e200 < x < 3.90000000000000017e104

    1. Initial program 99.9%

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

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

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

Alternative 5: 91.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+199} \lor \neg \left(x \leq 1.36 \cdot 10^{+105}\right):\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3000000000000001e199 or 1.3599999999999999e105 < x

    1. Initial program 99.7%

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

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

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

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

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

    if -1.3000000000000001e199 < x < 1.3599999999999999e105

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.2% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t + \left(z + \left(t\_1 + t\_2\right)\right)\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

    if -1.41999999999999991e230 < x < 1.5999999999999999e113

    1. Initial program 99.9%

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

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

    if 1.5999999999999999e113 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 89.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. Step-by-step derivation
      1. associate-+r+89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 8: 98.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 9: 87.9% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+203} \lor \neg \left(x \leq 1.36 \cdot 10^{+105}\right) \land \left(x \leq 2.3 \cdot 10^{+194} \lor \neg \left(x \leq 1.35 \cdot 10^{+243}\right)\right):\\
\;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.5999999999999998e203 or 1.3599999999999999e105 < x < 2.30000000000000005e194 or 1.3500000000000001e243 < x

    1. Initial program 99.7%

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

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

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

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

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

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

    if -4.5999999999999998e203 < x < 1.3599999999999999e105 or 2.30000000000000005e194 < x < 1.3500000000000001e243

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{+203} \lor \neg \left(x \leq 1.36 \cdot 10^{+105}\right) \land \left(x \leq 2.3 \cdot 10^{+194} \lor \neg \left(x \leq 1.35 \cdot 10^{+243}\right)\right):\\ \;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 89.3% accurate, 1.6× speedup?

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

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

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

\mathbf{elif}\;x \leq 2.25 \cdot 10^{+195} \lor \neg \left(x \leq 1.55 \cdot 10^{+243}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.7e205 or 1.35000000000000008e105 < x < 2.25000000000000005e195 or 1.55e243 < x

    1. Initial program 99.7%

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

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

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

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

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

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

    if -1.7e205 < x < 1.35000000000000008e105

    1. Initial program 99.9%

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

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

    if 2.25000000000000005e195 < x < 1.55e243

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{+205}:\\ \;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+105}:\\ \;\;\;\;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.25 \cdot 10^{+195} \lor \neg \left(x \leq 1.55 \cdot 10^{+243}\right):\\ \;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 60.0% accurate, 1.7× speedup?

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

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

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

\mathbf{elif}\;z \leq -2000000 \lor \neg \left(z \leq 4.4 \cdot 10^{-290}\right):\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.00000000000000006e136

    1. Initial program 99.9%

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

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

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

    if -1.00000000000000006e136 < z < -3.1e81

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

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

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

    if -3.1e81 < z < -2e6 or 4.4000000000000002e-290 < 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 b around inf 99.5%

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

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

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

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

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

    if -2e6 < z < 4.4000000000000002e-290

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+136}:\\ \;\;\;\;y \cdot i + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+81}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + -0.5 \cdot \log c\right)\\ \mathbf{elif}\;z \leq -2000000 \lor \neg \left(z \leq 4.4 \cdot 10^{-290}\right):\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 39.6% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := a + y \cdot i\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+182}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -8.2 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.7 \cdot 10^{+82}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -7200000:\\
\;\;\;\;y \cdot i + b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.2e182 or -8.19999999999999996e160 < z < -2.6999999999999999e82

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

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

    if -7.2e182 < z < -8.19999999999999996e160 or -7.2e6 < 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 b around inf 98.6%

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

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

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

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

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

    if -2.6999999999999999e82 < z < -7.2e6

    1. Initial program 99.8%

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+182}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+160}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+82}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -7200000:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 71.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+80} \lor \neg \left(y \leq 3.8 \cdot 10^{+127}\right) \land y \leq 9 \cdot 10^{+145}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1e80 or 3.7999999999999998e127 < y < 8.9999999999999996e145

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

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

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

    if 1e80 < y < 3.7999999999999998e127 or 8.9999999999999996e145 < y

    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 b around inf 100.0%

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

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

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

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

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

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

Alternative 14: 63.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+120} \lor \neg \left(x \leq 1.75 \cdot 10^{+97}\right):\\
\;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7999999999999998e120 or 1.75e97 < x

    1. Initial program 99.8%

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

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

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

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

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

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

    if -3.7999999999999998e120 < x < 1.75e97

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{+120} \lor \neg \left(x \leq 1.75 \cdot 10^{+97}\right):\\ \;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 59.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.5 \cdot 10^{-292}:\\
\;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\

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


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

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

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

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

    if -7.00000000000000041e132 < z < 3.5e-292

    1. Initial program 99.8%

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

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

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

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

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

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

    if 3.5e-292 < 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 b around inf 99.5%

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

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

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

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

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

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

Alternative 16: 43.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-44}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.99999999999999991e-44

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

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

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

    if -1.99999999999999991e-44 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 17: 22.3% accurate, 9.5× speedup?

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

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

\mathbf{elif}\;z \leq -1.35 \cdot 10^{-11} \lor \neg \left(z \leq -4.2 \cdot 10^{-35}\right) \land z \leq -1.35 \cdot 10^{-148}:\\
\;\;\;\;y \cdot i\\

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


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

    1. Initial program 99.9%

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

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

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

    if -2.29999999999999988e82 < z < -1.35000000000000002e-11 or -4.2e-35 < z < -1.34999999999999994e-148

    1. Initial program 99.8%

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

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

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

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

    if -1.35000000000000002e-11 < z < -4.2e-35 or -1.34999999999999994e-148 < 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 20.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+82}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-11} \lor \neg \left(z \leq -4.2 \cdot 10^{-35}\right) \land z \leq -1.35 \cdot 10^{-148}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 39.5% accurate, 10.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+182} \lor \neg \left(z \leq -9 \cdot 10^{+160}\right) \land z \leq -2.7 \cdot 10^{+82}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.2e182 or -8.99999999999999959e160 < z < -2.6999999999999999e82

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

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

    if -7.2e182 < z < -8.99999999999999959e160 or -2.6999999999999999e82 < 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 b around inf 98.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+182} \lor \neg \left(z \leq -9 \cdot 10^{+160}\right) \land z \leq -2.7 \cdot 10^{+82}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 20.8% accurate, 36.4× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

    if -2.6999999999999999e82 < 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 20.5%

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

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

Alternative 20: 16.2% accurate, 219.0× speedup?

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

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

    \[\leadsto \color{blue}{a} \]
  4. Final simplification17.5%

    \[\leadsto a \]
  5. Add Preprocessing

Reproduce

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