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

Percentage Accurate: 99.8% → 99.8%
Time: 19.9s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+153} \lor \neg \left(x \leq 5 \cdot 10^{+141}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1e153 or 5.00000000000000025e141 < x

    1. Initial program 99.8%

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

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

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

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

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

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

    if -1e153 < x < 5.00000000000000025e141

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+152} \lor \neg \left(x \leq 5 \cdot 10^{+141}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.0999999999999998e152 or 5.00000000000000025e141 < x

    1. Initial program 99.8%

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

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

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

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

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

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

    if -4.0999999999999998e152 < x < 5.00000000000000025e141

    1. Initial program 99.9%

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

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 5: 75.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Simplified83.1%

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

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

    if 3.00000000000000011e73 < a

    1. Initial program 99.9%

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

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

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

Alternative 6: 75.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Simplified83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.1% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 8: 82.4% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  6. Simplified85.1%

    \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  7. Final simplification85.1%

    \[\leadsto y \cdot i + \left(\left(a + \left(z + x \cdot \log y\right)\right) + b \cdot \log c\right) \]
  8. Add Preprocessing

Alternative 9: 80.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4 \cdot 10^{-24} \lor \neg \left(i \leq 1.7 \cdot 10^{-132}\right):\\
\;\;\;\;\left(z + t\right) + \left(a + i \cdot \left(y + b \cdot \frac{\log c}{i}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -3.99999999999999969e-24 or 1.69999999999999991e-132 < i

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999969e-24 < i < 1.69999999999999991e-132

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 88.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+223} \lor \neg \left(x \leq 2.2 \cdot 10^{+238}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.7000000000000001e223 or 2.2e238 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000001e223 < x < 2.2e238

    1. Initial program 99.9%

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

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

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

Alternative 11: 60.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{+73}:\\
\;\;\;\;\left(z + t\right) + t\_1\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{+21}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.9999999999999995e99 or -5.5000000000000003e73 < z < -2.5e21

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999995e99 < z < -5.5000000000000003e73

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e21 < z

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Simplified83.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+99}:\\ \;\;\;\;\left(z + t\right) + \left(a + y \cdot i\right)\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+73}:\\ \;\;\;\;\left(z + t\right) + \left(a + b \cdot \log c\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+21}:\\ \;\;\;\;\left(z + t\right) + \left(a + y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 60.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{+21}:\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000009e145 < z < -2.6e21

    1. Initial program 99.8%

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

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

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

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

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

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

    if -2.6e21 < z

    1. Initial program 99.9%

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

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

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

Alternative 13: 81.5% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.81999999999999995e-50 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 58.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{+21}:\\
\;\;\;\;y \cdot i + \left(z + t\_1\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0999999999999999e146 < z < -2.6e21

    1. Initial program 99.8%

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

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

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

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

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

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

    if -2.6e21 < z

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Simplified83.4%

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

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

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

Alternative 15: 70.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.45 \cdot 10^{+221} \lor \neg \left(x \leq 2 \cdot 10^{+157}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.45e221 or 1.99999999999999997e157 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.45e221 < x < 1.99999999999999997e157

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + t\right) + \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    12. Applied egg-rr76.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.45 \cdot 10^{+221} \lor \neg \left(x \leq 2 \cdot 10^{+157}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(z + t\right) + \mathsf{fma}\left(y, i, a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 60.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e21 < z

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\left(a + \left(z + x \cdot \log y\right)\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Simplified83.4%

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

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

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

Alternative 17: 70.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+219} \lor \neg \left(x \leq 2 \cdot 10^{+157}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.04999999999999994e219 or 1.99999999999999997e157 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999994e219 < x < 1.99999999999999997e157

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 60.1% accurate, 12.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.2 \cdot 10^{-13} \lor \neg \left(i \leq 0.0096\right):\\
\;\;\;\;y \cdot i + \left(z + t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.19999999999999977e-13 or 0.00959999999999999916 < i

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999977e-13 < i < 0.00959999999999999916

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 51.6% accurate, 14.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.22 \cdot 10^{+141} \lor \neg \left(i \leq 1.02 \cdot 10^{+74}\right):\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.2199999999999999e141 or 1.02000000000000005e74 < i

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified63.5%

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

    if -1.2199999999999999e141 < i < 1.02000000000000005e74

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right)\right) + a \]
      5. metadata-eval82.8%

        \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right)\right) + a \]
      6. +-commutative82.8%

        \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right)\right) + a \]
      7. distribute-rgt-out82.8%

        \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \color{blue}{\left(-0.5 \cdot \log c + b \cdot \log c\right)}\right)\right) + a \]
      8. +-commutative82.8%

        \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \color{blue}{\left(b \cdot \log c + -0.5 \cdot \log c\right)}\right)\right) + a \]
      9. distribute-rgt-in82.8%

        \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \color{blue}{\log c \cdot \left(b + -0.5\right)}\right)\right) + a \]
      10. associate-+l+82.8%

        \[\leadsto \color{blue}{\left(t + z\right) + \left(\left(y \cdot i + \log c \cdot \left(b + -0.5\right)\right) + a\right)} \]
      11. +-commutative82.8%

        \[\leadsto \color{blue}{\left(z + t\right)} + \left(\left(y \cdot i + \log c \cdot \left(b + -0.5\right)\right) + a\right) \]
      12. +-commutative82.8%

        \[\leadsto \left(z + t\right) + \left(\color{blue}{\left(\log c \cdot \left(b + -0.5\right) + y \cdot i\right)} + a\right) \]
      13. fma-define82.8%

        \[\leadsto \left(z + t\right) + \left(\color{blue}{\mathsf{fma}\left(\log c, b + -0.5, y \cdot i\right)} + a\right) \]
      14. +-commutative82.8%

        \[\leadsto \left(z + t\right) + \left(\mathsf{fma}\left(\log c, \color{blue}{-0.5 + b}, y \cdot i\right) + a\right) \]
    7. Simplified82.8%

      \[\leadsto \color{blue}{\left(z + t\right) + \left(\mathsf{fma}\left(\log c, -0.5 + b, y \cdot i\right) + a\right)} \]
    8. Taylor expanded in y around inf 65.2%

      \[\leadsto \left(z + t\right) + \left(\color{blue}{i \cdot y} + a\right) \]
    9. Step-by-step derivation
      1. *-commutative65.2%

        \[\leadsto \left(z + t\right) + \left(\color{blue}{y \cdot i} + a\right) \]
    10. Simplified65.2%

      \[\leadsto \left(z + t\right) + \left(\color{blue}{y \cdot i} + a\right) \]
    11. Taylor expanded in y around 0 56.3%

      \[\leadsto \left(z + t\right) + \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.22 \cdot 10^{+141} \lor \neg \left(i \leq 1.02 \cdot 10^{+74}\right):\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \left(z + t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 30.9% accurate, 16.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -7.4 \cdot 10^{-32} \lor \neg \left(i \leq 2.5 \cdot 10^{+14}\right):\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -7.4e-32) (not (<= i 2.5e+14))) (* y i) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -7.4e-32) || !(i <= 2.5e+14)) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((i <= (-7.4d-32)) .or. (.not. (i <= 2.5d+14))) then
        tmp = y * i
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -7.4e-32) || !(i <= 2.5e+14)) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (i <= -7.4e-32) or not (i <= 2.5e+14):
		tmp = y * i
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -7.4e-32) || !(i <= 2.5e+14))
		tmp = Float64(y * i);
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((i <= -7.4e-32) || ~((i <= 2.5e+14)))
		tmp = y * i;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -7.4e-32], N[Not[LessEqual[i, 2.5e+14]], $MachinePrecision]], N[(y * i), $MachinePrecision], a]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -7.4 \cdot 10^{-32} \lor \neg \left(i \leq 2.5 \cdot 10^{+14}\right):\\
\;\;\;\;y \cdot i\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -7.4e-32 or 2.5e14 < i

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+l+99.8%

        \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. associate-+r+99.8%

        \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. +-commutative99.8%

        \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      6. +-commutative99.8%

        \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      9. +-commutative99.8%

        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      10. fma-define99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      11. +-commutative99.8%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      12. fma-define99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      13. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      14. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      15. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 50.0%

      \[\leadsto \color{blue}{i \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative50.0%

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified50.0%

      \[\leadsto \color{blue}{y \cdot i} \]

    if -7.4e-32 < i < 2.5e14

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. +-commutative99.9%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+l+99.9%

        \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. +-commutative99.9%

        \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      6. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      9. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      10. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      11. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      12. fma-define99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      13. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      14. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      15. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.9%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-+r+67.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)} \]
      2. associate-+r+67.9%

        \[\leadsto x \cdot \left(\left(\log y + \frac{a}{x}\right) + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)}\right) \]
      3. associate-+r+67.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \frac{z}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)} \]
      4. associate-+r+67.9%

        \[\leadsto x \cdot \left(\color{blue}{\left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \frac{z}{x}\right)\right)\right)} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      5. +-commutative67.9%

        \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \frac{a}{x}\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      6. +-commutative67.9%

        \[\leadsto x \cdot \left(\left(\log y + \left(\color{blue}{\left(\frac{z}{x} + \frac{t}{x}\right)} + \frac{a}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      7. associate-+l+67.9%

        \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\frac{z}{x} + \left(\frac{t}{x} + \frac{a}{x}\right)\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      8. +-commutative67.9%

        \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \color{blue}{\left(\frac{a}{x} + \frac{t}{x}\right)}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      9. +-commutative67.9%

        \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \color{blue}{\left(\frac{\log c \cdot \left(b - 0.5\right)}{x} + \frac{i \cdot y}{x}\right)}\right) \]
    7. Simplified67.9%

      \[\leadsto \color{blue}{x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \mathsf{fma}\left(\log c, \frac{-0.5 + b}{x}, \frac{y \cdot i}{x}\right)\right)} \]
    8. Taylor expanded in a around inf 15.3%

      \[\leadsto x \cdot \color{blue}{\frac{a}{x}} \]
    9. Taylor expanded in x around 0 23.1%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -7.4 \cdot 10^{-32} \lor \neg \left(i \leq 2.5 \cdot 10^{+14}\right):\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 28.3% accurate, 16.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.25 \cdot 10^{-179}:\\ \;\;\;\;x \cdot \frac{z}{x}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+94}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y 1.25e-179) (* x (/ z x)) (if (<= y 3.5e+94) a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 1.25e-179) {
		tmp = x * (z / x);
	} else if (y <= 3.5e+94) {
		tmp = a;
	} else {
		tmp = y * i;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= 1.25d-179) then
        tmp = x * (z / x)
    else if (y <= 3.5d+94) then
        tmp = a
    else
        tmp = y * i
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 1.25e-179) {
		tmp = x * (z / x);
	} else if (y <= 3.5e+94) {
		tmp = a;
	} else {
		tmp = y * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= 1.25e-179:
		tmp = x * (z / x)
	elif y <= 3.5e+94:
		tmp = a
	else:
		tmp = y * i
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= 1.25e-179)
		tmp = Float64(x * Float64(z / x));
	elseif (y <= 3.5e+94)
		tmp = a;
	else
		tmp = Float64(y * i);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= 1.25e-179)
		tmp = x * (z / x);
	elseif (y <= 3.5e+94)
		tmp = a;
	else
		tmp = y * i;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.25e-179], N[(x * N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+94], a, N[(y * i), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-179}:\\
\;\;\;\;x \cdot \frac{z}{x}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+94}:\\
\;\;\;\;a\\

\mathbf{else}:\\
\;\;\;\;y \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.2499999999999999e-179

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+l+99.8%

        \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. associate-+r+99.8%

        \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. +-commutative99.8%

        \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      6. +-commutative99.8%

        \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      9. +-commutative99.8%

        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      10. fma-define99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      11. +-commutative99.8%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      12. fma-define99.8%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      13. sub-neg99.8%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      14. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      15. +-commutative99.8%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.5%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-+r+77.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)} \]
      2. associate-+r+77.5%

        \[\leadsto x \cdot \left(\left(\log y + \frac{a}{x}\right) + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)}\right) \]
      3. associate-+r+77.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \frac{z}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)} \]
      4. associate-+r+77.5%

        \[\leadsto x \cdot \left(\color{blue}{\left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \frac{z}{x}\right)\right)\right)} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      5. +-commutative77.5%

        \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \frac{a}{x}\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      6. +-commutative77.5%

        \[\leadsto x \cdot \left(\left(\log y + \left(\color{blue}{\left(\frac{z}{x} + \frac{t}{x}\right)} + \frac{a}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      7. associate-+l+77.5%

        \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\frac{z}{x} + \left(\frac{t}{x} + \frac{a}{x}\right)\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      8. +-commutative77.5%

        \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \color{blue}{\left(\frac{a}{x} + \frac{t}{x}\right)}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      9. +-commutative77.5%

        \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \color{blue}{\left(\frac{\log c \cdot \left(b - 0.5\right)}{x} + \frac{i \cdot y}{x}\right)}\right) \]
    7. Simplified77.5%

      \[\leadsto \color{blue}{x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \mathsf{fma}\left(\log c, \frac{-0.5 + b}{x}, \frac{y \cdot i}{x}\right)\right)} \]
    8. Taylor expanded in z around inf 17.0%

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} \]

    if 1.2499999999999999e-179 < y < 3.4999999999999997e94

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+l+99.8%

        \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. associate-+r+99.8%

        \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. +-commutative99.8%

        \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      6. +-commutative99.8%

        \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      9. +-commutative99.8%

        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      10. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      11. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      12. fma-define99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      13. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      14. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      15. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 74.5%

      \[\leadsto \color{blue}{x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-+r+74.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)} \]
      2. associate-+r+74.5%

        \[\leadsto x \cdot \left(\left(\log y + \frac{a}{x}\right) + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)}\right) \]
      3. associate-+r+74.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \frac{z}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)} \]
      4. associate-+r+74.5%

        \[\leadsto x \cdot \left(\color{blue}{\left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \frac{z}{x}\right)\right)\right)} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      5. +-commutative74.5%

        \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \frac{a}{x}\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      6. +-commutative74.5%

        \[\leadsto x \cdot \left(\left(\log y + \left(\color{blue}{\left(\frac{z}{x} + \frac{t}{x}\right)} + \frac{a}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      7. associate-+l+74.5%

        \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\frac{z}{x} + \left(\frac{t}{x} + \frac{a}{x}\right)\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      8. +-commutative74.5%

        \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \color{blue}{\left(\frac{a}{x} + \frac{t}{x}\right)}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
      9. +-commutative74.5%

        \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \color{blue}{\left(\frac{\log c \cdot \left(b - 0.5\right)}{x} + \frac{i \cdot y}{x}\right)}\right) \]
    7. Simplified74.5%

      \[\leadsto \color{blue}{x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \mathsf{fma}\left(\log c, \frac{-0.5 + b}{x}, \frac{y \cdot i}{x}\right)\right)} \]
    8. Taylor expanded in a around inf 14.9%

      \[\leadsto x \cdot \color{blue}{\frac{a}{x}} \]
    9. Taylor expanded in x around 0 19.2%

      \[\leadsto \color{blue}{a} \]

    if 3.4999999999999997e94 < y

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. +-commutative99.9%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+l+99.9%

        \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. +-commutative99.9%

        \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      6. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      8. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      9. +-commutative99.9%

        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      10. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      11. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      12. fma-define99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
      13. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      14. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
      15. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 56.3%

      \[\leadsto \color{blue}{i \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative56.3%

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified56.3%

      \[\leadsto \color{blue}{y \cdot i} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.25 \cdot 10^{-179}:\\ \;\;\;\;x \cdot \frac{z}{x}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+94}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 67.6% accurate, 24.3× speedup?

\[\begin{array}{l} \\ \left(z + t\right) + \left(a + y \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (+ (+ z t) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (z + t) + (a + (y * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (z + t) + (a + (y * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (z + t) + (a + (y * i));
}
def code(x, y, z, t, a, b, c, i):
	return (z + t) + (a + (y * i))
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(z + t) + Float64(a + Float64(y * i)))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (z + t) + (a + (y * i));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z + t), $MachinePrecision] + N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(z + t\right) + \left(a + y \cdot i\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. +-commutative99.9%

      \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    3. associate-+l+99.9%

      \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    4. associate-+r+99.9%

      \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    5. +-commutative99.9%

      \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    6. +-commutative99.9%

      \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
    9. +-commutative99.9%

      \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    10. fma-define99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    11. +-commutative99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
    12. fma-define99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
    13. sub-neg99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
    14. metadata-eval99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
    15. +-commutative99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 84.8%

    \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - 0.5\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. +-commutative84.8%

      \[\leadsto \color{blue}{\left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - 0.5\right)\right)\right)\right) + a} \]
    2. associate-+r+84.8%

      \[\leadsto \color{blue}{\left(\left(t + z\right) + \left(i \cdot y + \log c \cdot \left(b - 0.5\right)\right)\right)} + a \]
    3. *-commutative84.8%

      \[\leadsto \left(\left(t + z\right) + \left(\color{blue}{y \cdot i} + \log c \cdot \left(b - 0.5\right)\right)\right) + a \]
    4. sub-neg84.8%

      \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right)\right) + a \]
    5. metadata-eval84.8%

      \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right)\right) + a \]
    6. +-commutative84.8%

      \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right)\right) + a \]
    7. distribute-rgt-out84.8%

      \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \color{blue}{\left(-0.5 \cdot \log c + b \cdot \log c\right)}\right)\right) + a \]
    8. +-commutative84.8%

      \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \color{blue}{\left(b \cdot \log c + -0.5 \cdot \log c\right)}\right)\right) + a \]
    9. distribute-rgt-in84.8%

      \[\leadsto \left(\left(t + z\right) + \left(y \cdot i + \color{blue}{\log c \cdot \left(b + -0.5\right)}\right)\right) + a \]
    10. associate-+l+84.8%

      \[\leadsto \color{blue}{\left(t + z\right) + \left(\left(y \cdot i + \log c \cdot \left(b + -0.5\right)\right) + a\right)} \]
    11. +-commutative84.8%

      \[\leadsto \color{blue}{\left(z + t\right)} + \left(\left(y \cdot i + \log c \cdot \left(b + -0.5\right)\right) + a\right) \]
    12. +-commutative84.8%

      \[\leadsto \left(z + t\right) + \left(\color{blue}{\left(\log c \cdot \left(b + -0.5\right) + y \cdot i\right)} + a\right) \]
    13. fma-define84.8%

      \[\leadsto \left(z + t\right) + \left(\color{blue}{\mathsf{fma}\left(\log c, b + -0.5, y \cdot i\right)} + a\right) \]
    14. +-commutative84.8%

      \[\leadsto \left(z + t\right) + \left(\mathsf{fma}\left(\log c, \color{blue}{-0.5 + b}, y \cdot i\right) + a\right) \]
  7. Simplified84.8%

    \[\leadsto \color{blue}{\left(z + t\right) + \left(\mathsf{fma}\left(\log c, -0.5 + b, y \cdot i\right) + a\right)} \]
  8. Taylor expanded in y around inf 69.7%

    \[\leadsto \left(z + t\right) + \left(\color{blue}{i \cdot y} + a\right) \]
  9. Step-by-step derivation
    1. *-commutative69.7%

      \[\leadsto \left(z + t\right) + \left(\color{blue}{y \cdot i} + a\right) \]
  10. Simplified69.7%

    \[\leadsto \left(z + t\right) + \left(\color{blue}{y \cdot i} + a\right) \]
  11. Final simplification69.7%

    \[\leadsto \left(z + t\right) + \left(a + y \cdot i\right) \]
  12. Add Preprocessing

Alternative 23: 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.9%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. +-commutative99.9%

      \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    3. associate-+l+99.9%

      \[\leadsto \left(a + \color{blue}{\left(x \cdot \log y + \left(z + t\right)\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    4. associate-+r+99.9%

      \[\leadsto \color{blue}{\left(\left(a + x \cdot \log y\right) + \left(z + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    5. +-commutative99.9%

      \[\leadsto \left(\left(a + x \cdot \log y\right) + \color{blue}{\left(t + z\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    6. +-commutative99.9%

      \[\leadsto \left(\color{blue}{\left(x \cdot \log y + a\right)} + \left(t + z\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
    9. +-commutative99.9%

      \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    10. fma-define99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    11. +-commutative99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
    12. fma-define99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)}\right) \]
    13. sub-neg99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{b + \left(-0.5\right)}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
    14. metadata-eval99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + \color{blue}{-0.5}, \log c, \left(\left(x \cdot \log y + a\right) + t\right) + z\right)\right) \]
    15. +-commutative99.9%

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\right)\right) \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 66.1%

    \[\leadsto \color{blue}{x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-+r+66.1%

      \[\leadsto x \cdot \color{blue}{\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \left(\frac{z}{x} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\right)\right)} \]
    2. associate-+r+66.1%

      \[\leadsto x \cdot \left(\left(\log y + \frac{a}{x}\right) + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)}\right) \]
    3. associate-+r+66.1%

      \[\leadsto x \cdot \color{blue}{\left(\left(\left(\log y + \frac{a}{x}\right) + \left(\frac{t}{x} + \frac{z}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)} \]
    4. associate-+r+66.1%

      \[\leadsto x \cdot \left(\color{blue}{\left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \frac{z}{x}\right)\right)\right)} + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
    5. +-commutative66.1%

      \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\left(\frac{t}{x} + \frac{z}{x}\right) + \frac{a}{x}\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
    6. +-commutative66.1%

      \[\leadsto x \cdot \left(\left(\log y + \left(\color{blue}{\left(\frac{z}{x} + \frac{t}{x}\right)} + \frac{a}{x}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
    7. associate-+l+66.1%

      \[\leadsto x \cdot \left(\left(\log y + \color{blue}{\left(\frac{z}{x} + \left(\frac{t}{x} + \frac{a}{x}\right)\right)}\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
    8. +-commutative66.1%

      \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \color{blue}{\left(\frac{a}{x} + \frac{t}{x}\right)}\right)\right) + \left(\frac{i \cdot y}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right) \]
    9. +-commutative66.1%

      \[\leadsto x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \color{blue}{\left(\frac{\log c \cdot \left(b - 0.5\right)}{x} + \frac{i \cdot y}{x}\right)}\right) \]
  7. Simplified66.1%

    \[\leadsto \color{blue}{x \cdot \left(\left(\log y + \left(\frac{z}{x} + \left(\frac{a}{x} + \frac{t}{x}\right)\right)\right) + \mathsf{fma}\left(\log c, \frac{-0.5 + b}{x}, \frac{y \cdot i}{x}\right)\right)} \]
  8. Taylor expanded in a around inf 14.5%

    \[\leadsto x \cdot \color{blue}{\frac{a}{x}} \]
  9. Taylor expanded in x around 0 17.8%

    \[\leadsto \color{blue}{a} \]
  10. Final simplification17.8%

    \[\leadsto a \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2024096 
(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)))