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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+181} \lor \neg \left(x \leq 8.5 \cdot 10^{+187}\right):\\
\;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + x \cdot \log y\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.19999999999999995e181 or 8.49999999999999989e187 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999995e181 < x < 8.49999999999999989e187

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 4: 90.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+181} \lor \neg \left(x \leq 3.6 \cdot 10^{+189}\right):\\
\;\;\;\;t + \left(t_1 + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.19999999999999978e181 or 3.60000000000000008e189 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999978e181 < x < 3.60000000000000008e189

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

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

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

Alternative 5: 90.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+181} \lor \neg \left(x \leq 2.5 \cdot 10^{+189}\right):\\
\;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(z + x \cdot \log y\right)\right)\\

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


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5e181 < x < 2.5000000000000002e189

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+181} \lor \neg \left(x \leq 6 \cdot 10^{+187}\right):\\
\;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.0000000000000003e181 or 5.9999999999999998e187 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e181 < x < 5.9999999999999998e187

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 90.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+223}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, t_1\right)\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+192}:\\ \;\;\;\;y \cdot i + \left(t_2 + \left(a + \left(t + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \left(t_2 + \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))) (t_2 (* (log c) (- b 0.5))))
   (if (<= x -1.15e+223)
     (+ t (fma y i t_1))
     (if (<= x 4.3e+192)
       (+ (* y i) (+ t_2 (+ a (+ t z))))
       (+ t (+ t_2 (+ a t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * log(y);
	double t_2 = log(c) * (b - 0.5);
	double tmp;
	if (x <= -1.15e+223) {
		tmp = t + fma(y, i, t_1);
	} else if (x <= 4.3e+192) {
		tmp = (y * i) + (t_2 + (a + (t + z)));
	} else {
		tmp = t + (t_2 + (a + t_1));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	t_2 = Float64(log(c) * Float64(b - 0.5))
	tmp = 0.0
	if (x <= -1.15e+223)
		tmp = Float64(t + fma(y, i, t_1));
	elseif (x <= 4.3e+192)
		tmp = Float64(Float64(y * i) + Float64(t_2 + Float64(a + Float64(t + z))));
	else
		tmp = Float64(t + Float64(t_2 + 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]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+223], N[(t + N[(y * i + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e+192], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(t$95$2 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+223}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, t_1\right)\\

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

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


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

    1. Initial program 99.6%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15000000000000002e223 < x < 4.29999999999999976e192

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

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

    if 4.29999999999999976e192 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+222} \lor \neg \left(x \leq 1.45 \cdot 10^{+194}\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, i, x \cdot \log y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3000000000000001e222 or 1.45e194 < x

    1. Initial program 99.6%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3000000000000001e222 < x < 1.45e194

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

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

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

Alternative 9: 88.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+222} \lor \neg \left(x \leq 2.05 \cdot 10^{+194}\right):\\
\;\;\;\;t + x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.2000000000000002e222 or 2.05e194 < x

    1. Initial program 99.6%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000002e222 < x < 2.05e194

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

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

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

Alternative 10: 55.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.1 \cdot 10^{+178} \lor \neg \left(i \leq 8.5 \cdot 10^{+110}\right) \land \left(i \leq 1.9 \cdot 10^{+191} \lor \neg \left(i \leq 1.9 \cdot 10^{+264}\right)\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -2.0999999999999999e178 or 8.5000000000000004e110 < i < 1.8999999999999999e191 or 1.9000000000000001e264 < i

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]

    if -2.0999999999999999e178 < i < 8.5000000000000004e110 or 1.8999999999999999e191 < i < 1.9000000000000001e264

    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 x around 0 85.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2.1 \cdot 10^{+178} \lor \neg \left(i \leq 8.5 \cdot 10^{+110}\right) \land \left(i \leq 1.9 \cdot 10^{+191} \lor \neg \left(i \leq 1.9 \cdot 10^{+264}\right)\right):\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\ \mathbf{else}:\\ \;\;\;\;\log c \cdot \left(b - 0.5\right) + \left(a + z\right)\\ \end{array} \]

Alternative 11: 67.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right) + \left(a + z\right)\\ t_2 := t + \mathsf{fma}\left(y, i, a\right)\\ \mathbf{if}\;i \leq -1.06 \cdot 10^{+178}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq 2.5 \cdot 10^{+118}:\\ \;\;\;\;t + t_1\\ \mathbf{elif}\;i \leq 4.2 \cdot 10^{+191} \lor \neg \left(i \leq 5 \cdot 10^{+264}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* (log c) (- b 0.5)) (+ a z))) (t_2 (+ t (fma y i a))))
   (if (<= i -1.06e+178)
     t_2
     (if (<= i 2.5e+118)
       (+ t t_1)
       (if (or (<= i 4.2e+191) (not (<= i 5e+264))) t_2 t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (log(c) * (b - 0.5)) + (a + z);
	double t_2 = t + fma(y, i, a);
	double tmp;
	if (i <= -1.06e+178) {
		tmp = t_2;
	} else if (i <= 2.5e+118) {
		tmp = t + t_1;
	} else if ((i <= 4.2e+191) || !(i <= 5e+264)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + z))
	t_2 = Float64(t + fma(y, i, a))
	tmp = 0.0
	if (i <= -1.06e+178)
		tmp = t_2;
	elseif (i <= 2.5e+118)
		tmp = Float64(t + t_1);
	elseif ((i <= 4.2e+191) || !(i <= 5e+264))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(y * i + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.06e+178], t$95$2, If[LessEqual[i, 2.5e+118], N[(t + t$95$1), $MachinePrecision], If[Or[LessEqual[i, 4.2e+191], N[Not[LessEqual[i, 5e+264]], $MachinePrecision]], t$95$2, t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;i \leq 2.5 \cdot 10^{+118}:\\
\;\;\;\;t + t_1\\

\mathbf{elif}\;i \leq 4.2 \cdot 10^{+191} \lor \neg \left(i \leq 5 \cdot 10^{+264}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.05999999999999994e178 or 2.49999999999999986e118 < i < 4.2000000000000001e191 or 5.00000000000000033e264 < i

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]

    if -1.05999999999999994e178 < i < 2.49999999999999986e118

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e191 < i < 5.00000000000000033e264

    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 x around 0 89.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.06 \cdot 10^{+178}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\ \mathbf{elif}\;i \leq 2.5 \cdot 10^{+118}:\\ \;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(a + z\right)\right)\\ \mathbf{elif}\;i \leq 4.2 \cdot 10^{+191} \lor \neg \left(i \leq 5 \cdot 10^{+264}\right):\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\ \mathbf{else}:\\ \;\;\;\;\log c \cdot \left(b - 0.5\right) + \left(a + z\right)\\ \end{array} \]

Alternative 12: 74.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+223} \lor \neg \left(x \leq 2.05 \cdot 10^{+194}\right):\\
\;\;\;\;t + x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.9000000000000002e223 or 2.05e194 < x

    1. Initial program 99.6%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000002e223 < x < 2.05e194

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

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

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

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

Alternative 13: 35.3% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.8 \cdot 10^{+23}:\\
\;\;\;\;t + z\\

\mathbf{elif}\;a \leq 5 \cdot 10^{+120}:\\
\;\;\;\;t + x \cdot \log y\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{+157}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 1.7999999999999999e23

    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. associate-+l+99.7%

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7999999999999999e23 < a < 5.00000000000000019e120

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000019e120 < a < 1.2e157

    1. Initial program 100.0%

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

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

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

    if 1.2e157 < a

    1. Initial program 99.9%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.8 \cdot 10^{+23}:\\ \;\;\;\;t + z\\ \mathbf{elif}\;a \leq 5 \cdot 10^{+120}:\\ \;\;\;\;t + x \cdot \log y\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+157}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;t + a\\ \end{array} \]

Alternative 14: 55.8% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+174}:\\
\;\;\;\;t + z\\

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


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

    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. associate-+l+100.0%

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6000000000000002e174 < 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. associate-+l+99.8%

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+174}:\\ \;\;\;\;t + z\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\ \end{array} \]

Alternative 15: 22.4% accurate, 43.3× speedup?

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

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

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


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

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

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

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

    if 1.28000000000000001e157 < a

    1. Initial program 99.9%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.28 \cdot 10^{+157}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;t + a\\ \end{array} \]

Alternative 16: 35.9% accurate, 43.3× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000006e156 < a

    1. Initial program 99.9%

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

        \[\leadsto \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)} + y \cdot i \]
      2. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 7 \cdot 10^{+156}:\\ \;\;\;\;t + z\\ \mathbf{else}:\\ \;\;\;\;t + a\\ \end{array} \]

Alternative 17: 21.3% accurate, 71.5× speedup?

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

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

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


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

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

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

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

    if 1.2e157 < a

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.2 \cdot 10^{+157}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 18: 15.7% accurate, 219.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{a} \]
  4. Final simplification18.0%

    \[\leadsto a \]

Reproduce

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