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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+52} \lor \neg \left(b - 0.5 \leq 10^{+142}\right):\\
\;\;\;\;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(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + -0.5 \cdot \log c\right)\\


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

    1. Initial program 99.7%

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

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

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

    1. Initial program 99.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+52} \lor \neg \left(b - 0.5 \leq 10^{+142}\right):\\ \;\;\;\;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(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + -0.5 \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 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.4%

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

    \[\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 4: 72.5% accurate, 1.7× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.80000000000000007e184 or 2.4e97 < x

    1. Initial program 98.3%

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 + \color{blue}{\frac{x \cdot \log y}{z}}\right) + y \cdot i \]
    7. Step-by-step derivation
      1. associate-*r/59.3%

        \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    8. Simplified59.3%

      \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    9. Taylor expanded in x around inf 79.2%

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

    if -1.80000000000000007e184 < x < 9.6e-151

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

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

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

    if 9.6e-151 < x < 8.79999999999999943e-82

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

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

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

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

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

    if 8.79999999999999943e-82 < x < 2.4e97

    1. Initial program 99.9%

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

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

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

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

Alternative 5: 72.3% accurate, 1.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.9000000000000001e184 or 3.29999999999999984e96 < x

    1. Initial program 98.3%

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 + \color{blue}{\frac{x \cdot \log y}{z}}\right) + y \cdot i \]
    7. Step-by-step derivation
      1. associate-*r/59.3%

        \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    8. Simplified59.3%

      \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    9. Taylor expanded in x around inf 79.2%

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

    if -1.9000000000000001e184 < x < 1.69999999999999995e-135

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

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

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

    if 1.69999999999999995e-135 < x < 3.29999999999999984e96

    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 \]
    4. Taylor expanded in z around inf 74.0%

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

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

Alternative 6: 90.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{+189} \lor \neg \left(x \leq 5.2 \cdot 10^{+141}\right):\\
\;\;\;\;y \cdot i + x \cdot \left(\log y + \frac{z}{x}\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(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 < -2.14999999999999999e189 or 5.1999999999999999e141 < x

    1. Initial program 98.2%

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 + \color{blue}{\frac{x \cdot \log y}{z}}\right) + y \cdot i \]
    7. Step-by-step derivation
      1. associate-*r/60.5%

        \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    8. Simplified60.5%

      \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    9. Taylor expanded in x around inf 82.9%

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

    if -2.14999999999999999e189 < x < 5.1999999999999999e141

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

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

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

Alternative 7: 72.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+185}:\\
\;\;\;\;x \cdot \left(\log y + i \cdot \frac{y}{x}\right)\\

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

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

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


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

    1. Initial program 96.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 z around inf 60.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
    10. Taylor expanded in x around inf 79.6%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \frac{i \cdot y}{x}\right)} \]
    11. Step-by-step derivation
      1. associate-/l*82.7%

        \[\leadsto x \cdot \left(\log y + \color{blue}{i \cdot \frac{y}{x}}\right) \]
    12. Simplified82.7%

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

    if -3.60000000000000029e185 < x < 1.40000000000000012e-135

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

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

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

    if 1.40000000000000012e-135 < x < 3.79999999999999997e80

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

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

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

    if 3.79999999999999997e80 < 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 y around 0 83.9%

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

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

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

Alternative 8: 71.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+184}:\\
\;\;\;\;x \cdot \left(\log y + i \cdot \frac{y}{x}\right)\\

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

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

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


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

    1. Initial program 96.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 z around inf 60.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
    10. Taylor expanded in x around inf 79.6%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \frac{i \cdot y}{x}\right)} \]
    11. Step-by-step derivation
      1. associate-/l*82.7%

        \[\leadsto x \cdot \left(\log y + \color{blue}{i \cdot \frac{y}{x}}\right) \]
    12. Simplified82.7%

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

    if -4.6e184 < x < 6.19999999999999955e-137

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

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

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

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

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

    if 6.19999999999999955e-137 < x < 4.20000000000000003e80

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

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

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

    if 4.20000000000000003e80 < 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 y around 0 83.9%

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

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

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

Alternative 9: 74.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+189} \lor \neg \left(x \leq 2.45 \cdot 10^{+145}\right):\\
\;\;\;\;x \cdot \left(\log y + i \cdot \frac{y}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4999999999999999e189 or 2.45000000000000001e145 < x

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
    10. Taylor expanded in x around inf 80.2%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \frac{i \cdot y}{x}\right)} \]
    11. Step-by-step derivation
      1. associate-/l*81.8%

        \[\leadsto x \cdot \left(\log y + \color{blue}{i \cdot \frac{y}{x}}\right) \]
    12. Simplified81.8%

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

    if -1.4999999999999999e189 < x < 2.45000000000000001e145

    1. Initial program 99.9%

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

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

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

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

Alternative 10: 75.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+186}:\\
\;\;\;\;x \cdot \left(\log y + i \cdot \frac{y}{x}\right)\\

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

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


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

    1. Initial program 96.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 z around inf 60.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
    10. Taylor expanded in x around inf 79.6%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \frac{i \cdot y}{x}\right)} \]
    11. Step-by-step derivation
      1. associate-/l*82.7%

        \[\leadsto x \cdot \left(\log y + \color{blue}{i \cdot \frac{y}{x}}\right) \]
    12. Simplified82.7%

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

    if -4.7999999999999999e186 < x < 9.7999999999999997e79

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

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

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

    if 9.7999999999999997e79 < 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 y around 0 83.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+186}:\\ \;\;\;\;x \cdot \left(\log y + i \cdot \frac{y}{x}\right)\\ \mathbf{elif}\;x \leq 9.8 \cdot 10^{+79}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+189} \lor \neg \left(x \leq 2.45 \cdot 10^{+145}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5000000000000002e189 or 2.45000000000000001e145 < x

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5000000000000002e189 < x < 2.45000000000000001e145

    1. Initial program 99.9%

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

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

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

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

Alternative 12: 72.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+237} \lor \neg \left(x \leq 9 \cdot 10^{+187}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5e237 or 9.00000000000000052e187 < x

    1. Initial program 97.0%

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

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

    if -7.5e237 < x < 9.00000000000000052e187

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

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

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

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

Alternative 13: 23.0% accurate, 13.6× speedup?

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

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

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-144}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 4 \cdot 10^{+146}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.79999999999999998e-237 or 5.8000000000000004e-144 < a < 3.99999999999999973e146

    1. Initial program 99.2%

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

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

    if -1.79999999999999998e-237 < a < 5.8000000000000004e-144

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified31.9%

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

    if 3.99999999999999973e146 < a

    1. Initial program 99.9%

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

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

Alternative 14: 43.4% accurate, 21.9× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 + \color{blue}{\frac{x \cdot \log y}{z}}\right) + y \cdot i \]
    7. Step-by-step derivation
      1. associate-*r/48.9%

        \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) + y \cdot i \]
    8. Simplified48.9%

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

      \[\leadsto \color{blue}{z + i \cdot y} \]
    10. Step-by-step derivation
      1. *-commutative39.8%

        \[\leadsto z + \color{blue}{y \cdot i} \]
    11. Simplified39.8%

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

    if 2.2499999999999999e145 < a

    1. Initial program 99.9%

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

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

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

Alternative 15: 41.8% accurate, 21.9× speedup?

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

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

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


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

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

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

    if -2e188 < z

    1. Initial program 99.4%

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

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

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

Alternative 16: 68.1% accurate, 24.3× speedup?

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

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

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

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

    \[\leadsto \left(a + \left(t + \color{blue}{z}\right)\right) + y \cdot i \]
  5. Final simplification65.0%

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

Alternative 17: 21.2% accurate, 36.4× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

    if 3.20000000000000008e145 < a

    1. Initial program 99.9%

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

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

Alternative 18: 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.4%

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

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

Reproduce

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