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

Percentage Accurate: 99.8% → 99.8%
Time: 21.1s
Alternatives: 25
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 25 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} \\ \left(z + a\right) + \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, t\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ z a) (fma (+ b -0.5) (log c) (fma y i (fma x (log y) t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (z + a) + fma((b + -0.5), log(c), fma(y, i, fma(x, log(y), t)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(z + a) + fma(Float64(b + -0.5), log(c), fma(y, i, fma(x, log(y), t))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z + a), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + N[(x * N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(z + a\right) + \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, t\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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.6% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -9.9999999999999993e167

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999993e167 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 2e216

    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 0 97.0%

      \[\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 \]

    if 2e216 < (*.f64 (-.f64 b 1/2) (log.f64 c))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 0.7× speedup?

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

\\
\left(\mathsf{fma}\left(x, \log y, z\right) + \left(a + t\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\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. associate-+l+99.8%

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

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

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

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

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 5: 89.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+184} \lor \neg \left(x \leq 2 \cdot 10^{+171}\right):\\
\;\;\;\;x \cdot \log y + \left(a + \left(z + -0.5 \cdot \log c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.90000000000000029e184 or 1.99999999999999991e171 < 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 0 96.7%

      \[\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 \]
    3. Taylor expanded in t around 0 87.0%

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

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

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

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

    if -4.90000000000000029e184 < x < 1.99999999999999991e171

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+170} \lor \neg \left(x \leq 4.8 \cdot 10^{+166}\right):\\
\;\;\;\;y \cdot i + \left(-0.5 \cdot \log c + \left(a + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9500000000000001e170 or 4.79999999999999984e166 < 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 0 96.9%

      \[\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 \]
    3. Taylor expanded in x around inf 83.0%

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

    if -1.9500000000000001e170 < x < 4.79999999999999984e166

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+170} \lor \neg \left(x \leq 4.8 \cdot 10^{+166}\right):\\ \;\;\;\;y \cdot i + \left(-0.5 \cdot \log c + \left(a + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) + \mathsf{fma}\left(b + -0.5, \log c, t + y \cdot i\right)\\ \end{array} \]

Alternative 7: 92.1% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0000000000000002e175 < x < 4.59999999999999976e167

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999976e167 < 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 0 99.8%

      \[\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 \]
    3. Taylor expanded in x around inf 82.4%

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

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

Alternative 8: 89.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+177} \lor \neg \left(x \leq 1.4 \cdot 10^{+171}\right):\\
\;\;\;\;x \cdot \log y + \left(a + \left(z + -0.5 \cdot \log c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.34999999999999995e177 or 1.40000000000000002e171 < 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 0 96.7%

      \[\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 \]
    3. Taylor expanded in t around 0 87.0%

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

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

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

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

    if -1.34999999999999995e177 < x < 1.40000000000000002e171

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

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

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

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

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

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

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

Alternative 9: 88.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+189} \lor \neg \left(x \leq 2.1 \cdot 10^{+170}\right):\\
\;\;\;\;a + \left(-0.5 \cdot \log c + x \cdot \log y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.6e189 or 2.09999999999999998e170 < 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 0 96.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 \]
    3. Taylor expanded in x around inf 82.0%

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

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

    if -4.6e189 < x < 2.09999999999999998e170

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

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

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

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

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

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

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

Alternative 10: 59.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2.5 \cdot 10^{+205} \lor \neg \left(b - 0.5 \leq 5 \cdot 10^{+203}\right):\\
\;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -2.5000000000000001e205 or 4.99999999999999994e203 < (-.f64 b 1/2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5000000000000001e205 < (-.f64 b 1/2) < 4.99999999999999994e203

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 60.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2.5 \cdot 10^{+205} \lor \neg \left(b - 0.5 \leq 5 \cdot 10^{+192}\right):\\
\;\;\;\;\left(z + a\right) + b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -2.5000000000000001e205 or 5.00000000000000033e192 < (-.f64 b 1/2)

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5000000000000001e205 < (-.f64 b 1/2) < 5.00000000000000033e192

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 61.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b - 0.5 \leq -4 \cdot 10^{+166}:\\
\;\;\;\;y \cdot i + \left(a + t_1\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(z + a\right) + t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 b 1/2) < -3.99999999999999976e166

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999976e166 < (-.f64 b 1/2) < 5.00000000000000033e192

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000033e192 < (-.f64 b 1/2)

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -4 \cdot 10^{+166}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \mathbf{elif}\;b - 0.5 \leq 5 \cdot 10^{+192}:\\ \;\;\;\;\left(z + a\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) + b \cdot \log c\\ \end{array} \]

Alternative 13: 84.1% accurate, 1.9× speedup?

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

\\
y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(\left(z + a\right) + t\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 x around 0 81.0%

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

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

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

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

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

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

Alternative 14: 59.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;a \leq 1.65 \cdot 10^{+211}:\\
\;\;\;\;\left(z + a\right) + y \cdot i\\

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


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

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1499999999999999e156 < a < 1.64999999999999992e211

    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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.64999999999999992e211 < a

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.15 \cdot 10^{+156}:\\ \;\;\;\;y \cdot i + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+211}:\\ \;\;\;\;\left(z + a\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \end{array} \]

Alternative 15: 61.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-14}:\\
\;\;\;\;\left(z + a\right) + \left(y \cdot i + b \cdot \log c\right)\\

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


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

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.4999999999999999e-14 < 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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 73.9% accurate, 1.9× speedup?

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

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

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


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

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85000000000000007e-118 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.85 \cdot 10^{-118}:\\ \;\;\;\;\left(z + a\right) + \left(t + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) + \left(y \cdot i + b \cdot \log c\right)\\ \end{array} \]

Alternative 17: 69.4% accurate, 1.9× speedup?

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

\\
\left(z + a\right) + \left(y \cdot i + \log c \cdot \left(b - 0.5\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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 57.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{+251} \lor \neg \left(b \leq 1.8 \cdot 10^{+205}\right):\\
\;\;\;\;b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.9999999999999997e251 or 1.80000000000000001e205 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999997e251 < b < 1.80000000000000001e205

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9 \cdot 10^{+251} \lor \neg \left(b \leq 1.8 \cdot 10^{+205}\right):\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) + y \cdot i\\ \end{array} \]

Alternative 19: 22.3% accurate, 30.7× speedup?

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

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

\mathbf{elif}\;z \leq -2.75 \cdot 10^{+53}:\\
\;\;\;\;y \cdot i\\

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


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

    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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.75e159 < z < -2.74999999999999988e53

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.74999999999999988e53 < 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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+159}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{+53}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 20: 39.3% accurate, 30.7× speedup?

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

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

\mathbf{elif}\;i \leq 2.85 \cdot 10^{+135}:\\
\;\;\;\;z + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -5.0000000000000002e205 or 2.8500000000000001e135 < 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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e205 < i < 2.8500000000000001e135

    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 \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      2. associate-+l+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5 \cdot 10^{+205}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;i \leq 2.85 \cdot 10^{+135}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]

Alternative 21: 41.7% accurate, 31.0× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000001e156 < 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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a + i \cdot y} \]
    8. Step-by-step derivation
      1. +-commutative36.1%

        \[\leadsto \color{blue}{i \cdot y + a} \]
    9. Simplified36.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+156}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 22: 43.4% accurate, 31.0× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e111 < 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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a + i \cdot y} \]
    8. Step-by-step derivation
      1. +-commutative35.2%

        \[\leadsto \color{blue}{i \cdot y + a} \]
    9. Simplified35.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+111}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 23: 52.7% accurate, 31.3× speedup?

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

\\
\left(z + a\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. Step-by-step derivation
    1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 24: 21.9% accurate, 71.5× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999988e111 < 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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+111}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 25: 16.6% 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. Step-by-step derivation
    1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto a \]

Reproduce

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