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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.0% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.7 \cdot 10^{+184}:\\
\;\;\;\;a + \left(t + \left(z + \left(t\_1 + \log c \cdot \left(b - 0.5\right)\right)\right)\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.7e158

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

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

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

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

    if -1.7e158 < x < 1.60000000000000006e63

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000006e63 < x < 1.7000000000000001e184

    1. Initial program 99.9%

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

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

    if 1.7000000000000001e184 < 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 x around inf 99.7%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 91.6%

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

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

Alternative 3: 91.1% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

    if -1.65000000000000009e158 < x < 3.4000000000000001e174

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if 3.4000000000000001e174 < 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 x around inf 99.8%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 89.7%

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

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

Alternative 4: 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 5: 91.1% accurate, 1.8× speedup?

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

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

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


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

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

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

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

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

    if -1.65000000000000009e158 < x < 3.4999999999999999e173

    1. Initial program 99.9%

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

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

    if 3.4999999999999999e173 < 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 x around inf 99.8%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 89.7%

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

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

Alternative 6: 80.0% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.8e-101

    1. Initial program 99.9%

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

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

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

    if 1.8e-101 < y < 4.5e-63

    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 inf 80.8%

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

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

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

    if 4.5e-63 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 74.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.6 \cdot 10^{+210} \lor \neg \left(b \leq 3.9 \cdot 10^{+133}\right):\\
\;\;\;\;a + \left(\left(z + t\right) + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.6000000000000001e210 or 3.90000000000000014e133 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001e210 < b < 3.90000000000000014e133

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 59.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;z \leq -5 \cdot 10^{+144}:\\ \;\;\;\;y \cdot i + \left(z + t\_1\right)\\ \mathbf{elif}\;z \leq -3.65 \cdot 10^{+18}:\\ \;\;\;\;a + \left(\left(z + t\right) + b \cdot \log c\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))))
   (if (<= z -5e+144)
     (+ (* y i) (+ z t_1))
     (if (<= z -3.65e+18)
       (+ a (+ (+ z t) (* b (log c))))
       (+ (* 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 tmp;
	if (z <= -5e+144) {
		tmp = (y * i) + (z + t_1);
	} else if (z <= -3.65e+18) {
		tmp = a + ((z + t) + (b * log(c)));
	} 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) :: tmp
    t_1 = x * log(y)
    if (z <= (-5d+144)) then
        tmp = (y * i) + (z + t_1)
    else if (z <= (-3.65d+18)) then
        tmp = a + ((z + t) + (b * log(c)))
    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 tmp;
	if (z <= -5e+144) {
		tmp = (y * i) + (z + t_1);
	} else if (z <= -3.65e+18) {
		tmp = a + ((z + t) + (b * Math.log(c)));
	} 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)
	tmp = 0
	if z <= -5e+144:
		tmp = (y * i) + (z + t_1)
	elif z <= -3.65e+18:
		tmp = a + ((z + t) + (b * math.log(c)))
	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))
	tmp = 0.0
	if (z <= -5e+144)
		tmp = Float64(Float64(y * i) + Float64(z + t_1));
	elseif (z <= -3.65e+18)
		tmp = Float64(a + Float64(Float64(z + t) + Float64(b * log(c))));
	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);
	tmp = 0.0;
	if (z <= -5e+144)
		tmp = (y * i) + (z + t_1);
	elseif (z <= -3.65e+18)
		tmp = a + ((z + t) + (b * log(c)));
	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]}, If[LessEqual[z, -5e+144], N[(N[(y * i), $MachinePrecision] + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.65e+18], N[(a + N[(N[(z + t), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $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\\
\mathbf{if}\;z \leq -5 \cdot 10^{+144}:\\
\;\;\;\;y \cdot i + \left(z + t\_1\right)\\

\mathbf{elif}\;z \leq -3.65 \cdot 10^{+18}:\\
\;\;\;\;a + \left(\left(z + t\right) + b \cdot \log c\right)\\

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


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

    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 inf 70.4%

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

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

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

    if -4.9999999999999999e144 < z < -3.65e18

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.65e18 < 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 x around inf 75.5%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 59.9%

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

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

Alternative 9: 60.4% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+143}:\\ \;\;\;\;a + \left(y \cdot i + \left(z + t\right)\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+18}:\\ \;\;\;\;a + \left(\left(z + t\right) + 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 -3.1e+143)
   (+ a (+ (* y i) (+ z t)))
   (if (<= z -3.6e+18)
     (+ a (+ (+ z t) (* 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 <= -3.1e+143) {
		tmp = a + ((y * i) + (z + t));
	} else if (z <= -3.6e+18) {
		tmp = a + ((z + t) + (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 <= (-3.1d+143)) then
        tmp = a + ((y * i) + (z + t))
    else if (z <= (-3.6d+18)) then
        tmp = a + ((z + t) + (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 <= -3.1e+143) {
		tmp = a + ((y * i) + (z + t));
	} else if (z <= -3.6e+18) {
		tmp = a + ((z + t) + (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 <= -3.1e+143:
		tmp = a + ((y * i) + (z + t))
	elif z <= -3.6e+18:
		tmp = a + ((z + t) + (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 <= -3.1e+143)
		tmp = Float64(a + Float64(Float64(y * i) + Float64(z + t)));
	elseif (z <= -3.6e+18)
		tmp = Float64(a + Float64(Float64(z + t) + 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 <= -3.1e+143)
		tmp = a + ((y * i) + (z + t));
	elseif (z <= -3.6e+18)
		tmp = a + ((z + t) + (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, -3.1e+143], N[(a + N[(N[(y * i), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e+18], N[(a + N[(N[(z + t), $MachinePrecision] + 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 -3.1 \cdot 10^{+143}:\\
\;\;\;\;a + \left(y \cdot i + \left(z + t\right)\right)\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+18}:\\
\;\;\;\;a + \left(\left(z + t\right) + 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 3 regimes
  2. if z < -3.0999999999999999e143

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

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

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

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

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

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

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

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

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

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

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

    if -3.0999999999999999e143 < z < -3.6e18

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e18 < 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 x around inf 75.5%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 59.9%

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

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

Alternative 10: 71.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.9 \cdot 10^{+36}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + \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 (<= a 3.9e+36)
   (+ t (+ z (+ (* y i) (* (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 (a <= 3.9e+36) {
		tmp = t + (z + ((y * i) + (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 (a <= 3.9d+36) then
        tmp = t + (z + ((y * i) + (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 (a <= 3.9e+36) {
		tmp = t + (z + ((y * i) + (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 a <= 3.9e+36:
		tmp = t + (z + ((y * i) + (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 (a <= 3.9e+36)
		tmp = Float64(t + Float64(z + Float64(Float64(y * i) + 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 (a <= 3.9e+36)
		tmp = t + (z + ((y * i) + (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[LessEqual[a, 3.9e+36], N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + 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}\;a \leq 3.9 \cdot 10^{+36}:\\
\;\;\;\;t + \left(z + \left(y \cdot i + \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 a < 3.90000000000000021e36

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

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

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

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

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

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

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

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

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

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

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

    if 3.90000000000000021e36 < a

    1. Initial program 99.9%

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 66.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3.9 \cdot 10^{+36}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + \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 11: 72.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+224} \lor \neg \left(x \leq 1.56 \cdot 10^{+218}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.3999999999999999e224 or 1.55999999999999997e218 < 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 x around inf 76.2%

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

    if -4.3999999999999999e224 < x < 1.55999999999999997e218

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 43.7% accurate, 21.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+83}:\\
\;\;\;\;z + y \cdot i\\

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


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

    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 inf 70.0%

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

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

      \[\leadsto \color{blue}{z + i \cdot y} \]
    6. Step-by-step derivation
      1. +-commutative60.7%

        \[\leadsto \color{blue}{i \cdot y + z} \]
    7. Simplified60.7%

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

    if -1.14999999999999997e83 < 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 x around inf 76.7%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 41.0%

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

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

Alternative 13: 41.6% accurate, 21.9× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

    if -1.75000000000000003e170 < 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 x around inf 75.8%

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{a}{x}}\right) + y \cdot i \]
    5. Taylor expanded in x around 0 40.7%

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

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

Alternative 14: 68.0% accurate, 24.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 30.1% accurate, 27.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.8 \cdot 10^{+71}:\\
\;\;\;\;z\\

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


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

    1. Initial program 99.9%

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

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

    if 8.79999999999999978e71 < y

    1. Initial program 99.9%

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

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

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

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

Alternative 16: 21.1% accurate, 36.4× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

    if -8.50000000000000054e94 < 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 16.2%

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

Alternative 17: 16.3% 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 15.7%

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

Reproduce

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