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

Percentage Accurate: 99.8% → 99.8%
Time: 18.0s
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, t + \mathsf{fma}\left(x, \log y, z + 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) (+ t (fma x (log y) (+ z 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), (t + fma(x, log(y), (z + a)))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, fma(Float64(b - 0.5), log(c), Float64(t + fma(x, log(y), Float64(z + 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[(t + N[(x * N[Log[y], $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    8. +-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 + z\right) + a\right) + t\right)}\right) \]
    9. fma-def99.8%

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\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
 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (- 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 ((a + (t + (z + (x * log(y))))) + ((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 = ((a + (t + (z + (x * log(y))))) + ((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 ((a + (t + (z + (x * Math.log(y))))) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return ((a + (t + (z + (x * math.log(y))))) + ((b - 0.5) * math.log(c))) + (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(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = ((a + (t + (z + (x * log(y))))) + ((b - 0.5) * log(c))) + (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[(b - 0.5), $MachinePrecision] * N[Log[c], $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) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Derivation
  1. Initial program 99.8%

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

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

Alternative 3: 97.9% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 4: 94.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \left(t + z\right)\\ \mathbf{if}\;x \leq -1.22 \cdot 10^{+176}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + t_1\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+99}:\\ \;\;\;\;y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \mathsf{fma}\left(\log y, x, z + \left(t + a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (+ t z))))
   (if (<= x -1.22e+176)
     (+ (* y i) (+ (* x (log y)) t_1))
     (if (<= x 6.2e+99)
       (+ (* y i) (+ (* (- b 0.5) (log c)) t_1))
       (+ (* y i) (fma (log y) x (+ z (+ t a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (t + z);
	double tmp;
	if (x <= -1.22e+176) {
		tmp = (y * i) + ((x * log(y)) + t_1);
	} else if (x <= 6.2e+99) {
		tmp = (y * i) + (((b - 0.5) * log(c)) + t_1);
	} else {
		tmp = (y * i) + fma(log(y), x, (z + (t + a)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(t + z))
	tmp = 0.0
	if (x <= -1.22e+176)
		tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + t_1));
	elseif (x <= 6.2e+99)
		tmp = Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + t_1));
	else
		tmp = Float64(Float64(y * i) + fma(log(y), x, Float64(z + Float64(t + a))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.22e+176], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e+99], N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 6.2 \cdot 10^{+99}:\\
\;\;\;\;y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + t_1\right)\\

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


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

    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. Taylor expanded in b around inf 99.7%

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

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

    if -1.2199999999999999e176 < x < 6.2000000000000001e99

    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. Taylor expanded in x around 0 99.4%

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

    if 6.2000000000000001e99 < x

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(z + t\right)} + a\right) + y \cdot i \]
      4. associate-+l+96.5%

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

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

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

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

Alternative 5: 87.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+176} \lor \neg \left(b - 0.5 \leq 5 \cdot 10^{+82}\right):\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -2e176 or 5.00000000000000015e82 < (-.f64 b 1/2)

    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. Taylor expanded in a around inf 70.8%

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

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

    if -2e176 < (-.f64 b 1/2) < 5.00000000000000015e82

    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. Taylor expanded in b around inf 96.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+176} \lor \neg \left(b - 0.5 \leq 5 \cdot 10^{+82}\right):\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(t + z\right)\right)\right)\\ \end{array} \]

Alternative 6: 60.2% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;a \leq 0.0037:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{+71}:\\
\;\;\;\;y \cdot i + \left(a + t_1\right)\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{+105}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 2.6000000000000002e-69

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6000000000000002e-69 < a < 0.0037000000000000002 or 1.40000000000000001e71 < a < 1.3000000000000001e105

    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. Taylor expanded in b around inf 99.6%

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

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

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

    if 0.0037000000000000002 < a < 1.40000000000000001e71

    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. Taylor expanded in a around inf 49.0%

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

    if 1.3000000000000001e105 < 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. Taylor expanded in a around inf 74.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-69}:\\ \;\;\;\;y \cdot i + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{elif}\;a \leq 0.0037:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(t + z\right)\right)\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{+71}:\\ \;\;\;\;y \cdot i + \left(a + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+105}:\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(t + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \end{array} \]

Alternative 7: 94.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := a + \left(t + z\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+176} \lor \neg \left(x \leq 1.7 \cdot 10^{+98}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6e176 or 1.69999999999999986e98 < x

    1. Initial program 99.7%

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

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

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

    if -6e176 < x < 1.69999999999999986e98

    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. Taylor expanded in x around 0 99.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+176} \lor \neg \left(x \leq 1.7 \cdot 10^{+98}\right):\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(t + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)\\ \end{array} \]

Alternative 8: 61.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;z \leq -7.4 \cdot 10^{+58} \lor \neg \left(z \leq -2.4 \cdot 10^{+14}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(b - 0.5\right) \cdot \log c\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \log y + t_1\\


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

    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. Taylor expanded in b around inf 99.9%

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

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

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

    if -3.19999999999999994e110 < z < -7.4000000000000004e58 or -2.4e14 < z

    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. Taylor expanded in a around inf 59.0%

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

    if -7.4000000000000004e58 < z < -2.4e14

    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. Taylor expanded in b around inf 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+110}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + z\right)\right)\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{+58} \lor \neg \left(z \leq -2.4 \cdot 10^{+14}\right):\\ \;\;\;\;y \cdot i + \left(a + \left(b - 0.5\right) \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + \left(a + \left(t + z\right)\right)\\ \end{array} \]

Alternative 9: 93.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := a + \left(t + z\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+176} \lor \neg \left(x \leq 3 \cdot 10^{+95}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6e176 or 2.99999999999999991e95 < x

    1. Initial program 99.7%

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

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

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

    if -6e176 < x < 2.99999999999999991e95

    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. Taylor expanded in b around inf 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+176} \lor \neg \left(x \leq 3 \cdot 10^{+95}\right):\\ \;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(t + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + \left(t + z\right)\right)\right)\\ \end{array} \]

Alternative 10: 73.5% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 2.1 \cdot 10^{-32}:\\
\;\;\;\;y \cdot i + t_1\\

\mathbf{elif}\;x \leq 5.4 \cdot 10^{+60}:\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.89999999999999972e175 or 5.3999999999999999e60 < x

    1. Initial program 99.8%

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

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

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

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

    if -3.89999999999999972e175 < x < 2.0999999999999999e-32

    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. Taylor expanded in b around inf 96.2%

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

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

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

    if 2.0999999999999999e-32 < x < 5.3999999999999999e60

    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. Taylor expanded in a around inf 78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{+175}:\\ \;\;\;\;x \cdot \log y + \left(a + \left(t + z\right)\right)\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-32}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + z\right)\right)\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{+60}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + \left(a + \left(t + z\right)\right)\\ \end{array} \]

Alternative 11: 75.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := a + \left(t + z\right)\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{+175} \lor \neg \left(x \leq 9.5 \cdot 10^{+188}\right):\\
\;\;\;\;x \cdot \log y + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.55000000000000003e175 or 9.4999999999999996e188 < x

    1. Initial program 99.7%

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

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

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

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

    if -2.55000000000000003e175 < x < 9.4999999999999996e188

    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. Taylor expanded in b around inf 96.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{+175} \lor \neg \left(x \leq 9.5 \cdot 10^{+188}\right):\\ \;\;\;\;x \cdot \log y + \left(a + \left(t + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + z\right)\right)\\ \end{array} \]

Alternative 12: 74.4% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+197} \lor \neg \left(x \leq 6.8 \cdot 10^{+201}\right):\\
\;\;\;\;y \cdot i + x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.50000000000000046e197 or 6.8e201 < x

    1. Initial program 99.7%

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

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

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

    if -7.50000000000000046e197 < x < 6.8e201

    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. Taylor expanded in b around inf 96.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+197} \lor \neg \left(x \leq 6.8 \cdot 10^{+201}\right):\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + z\right)\right)\\ \end{array} \]

Alternative 13: 71.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+256} \lor \neg \left(b \leq 1.02 \cdot 10^{+229}\right):\\
\;\;\;\;b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.80000000000000028e256 or 1.01999999999999994e229 < b

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.80000000000000028e256 < b < 1.01999999999999994e229

    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. Taylor expanded in b around inf 96.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+256} \lor \neg \left(b \leq 1.02 \cdot 10^{+229}\right):\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + z\right)\right)\\ \end{array} \]

Alternative 14: 42.7% accurate, 19.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 0.52 \lor \neg \left(a \leq 9 \cdot 10^{+70}\right) \land a \leq 2.8 \cdot 10^{+108}:\\ \;\;\;\;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 (or (<= a 0.52) (and (not (<= a 9e+70)) (<= a 2.8e+108)))
   (+ 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 <= 0.52) || (!(a <= 9e+70) && (a <= 2.8e+108))) {
		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 <= 0.52d0) .or. (.not. (a <= 9d+70)) .and. (a <= 2.8d+108)) 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 <= 0.52) || (!(a <= 9e+70) && (a <= 2.8e+108))) {
		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 <= 0.52) or (not (a <= 9e+70) and (a <= 2.8e+108)):
		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 <= 0.52) || (!(a <= 9e+70) && (a <= 2.8e+108)))
		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 <= 0.52) || (~((a <= 9e+70)) && (a <= 2.8e+108)))
		tmp = z + (y * i);
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, 0.52], And[N[Not[LessEqual[a, 9e+70]], $MachinePrecision], LessEqual[a, 2.8e+108]]], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 0.52 \lor \neg \left(a \leq 9 \cdot 10^{+70}\right) \land a \leq 2.8 \cdot 10^{+108}:\\
\;\;\;\;z + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 0.52000000000000002 or 8.9999999999999999e70 < a < 2.7999999999999998e108

    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. Taylor expanded in b around inf 96.6%

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

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

    if 0.52000000000000002 < a < 8.9999999999999999e70 or 2.7999999999999998e108 < 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. Taylor expanded in b around inf 99.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 0.52 \lor \neg \left(a \leq 9 \cdot 10^{+70}\right) \land a \leq 2.8 \cdot 10^{+108}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 15: 67.1% accurate, 24.3× speedup?

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

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

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

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

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

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

    \[\leadsto y \cdot i + \left(a + \left(t + z\right)\right) \]

Alternative 16: 28.9% accurate, 30.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.6 \cdot 10^{+51}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;i \leq 7.2 \cdot 10^{+127}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.6000000000000001e51 or 7.19999999999999958e127 < i

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified49.8%

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

    if -4.6000000000000001e51 < i < 7.19999999999999958e127

    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. Taylor expanded in b around inf 96.1%

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
    4. Taylor expanded in a around inf 18.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+51}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;i \leq 7.2 \cdot 10^{+127}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]

Alternative 17: 37.5% accurate, 43.8× speedup?

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

\\
a + y \cdot i
\end{array}
Derivation
  1. Initial program 99.8%

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

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

    \[\leadsto \color{blue}{a} + y \cdot i \]
  4. Final simplification35.4%

    \[\leadsto a + y \cdot i \]

Alternative 18: 16.1% accurate, 219.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{a} + y \cdot i \]
  4. Taylor expanded in a around inf 16.1%

    \[\leadsto \color{blue}{a} \]
  5. Final simplification16.1%

    \[\leadsto a \]

Reproduce

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