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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.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. associate-+l+99.9%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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-def99.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-def99.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: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
    1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Derivation
  1. Initial program 99.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 y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) \]
  4. Add Preprocessing

Alternative 4: 91.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+102}:\\
\;\;\;\;y \cdot i + \left(z + \mathsf{fma}\left(x, \log y, a\right)\right)\\

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

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


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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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.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. Step-by-step derivation
      1. fma-udef99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot y + \left(z + \color{blue}{\left(a + x \cdot \log y\right)}\right) \]
    9. Step-by-step derivation
      1. log-pow14.7%

        \[\leadsto i \cdot y + \left(z + \left(a + \color{blue}{\log \left({y}^{x}\right)}\right)\right) \]
      2. +-commutative14.7%

        \[\leadsto i \cdot y + \left(z + \color{blue}{\left(\log \left({y}^{x}\right) + a\right)}\right) \]
      3. log-pow76.4%

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

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

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

    if -2.05e102 < x < 9.0000000000000003e137

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

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

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

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

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

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

      \[\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. associate-+r+98.4%

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

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

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

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

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

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

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

    if 9.0000000000000003e137 < 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. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 6: 91.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+104}:\\
\;\;\;\;y \cdot i + \left(z + \mathsf{fma}\left(x, \log y, a\right)\right)\\

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

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


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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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.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. Step-by-step derivation
      1. fma-udef99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot y + \left(z + \color{blue}{\left(a + x \cdot \log y\right)}\right) \]
    9. Step-by-step derivation
      1. log-pow14.7%

        \[\leadsto i \cdot y + \left(z + \left(a + \color{blue}{\log \left({y}^{x}\right)}\right)\right) \]
      2. +-commutative14.7%

        \[\leadsto i \cdot y + \left(z + \color{blue}{\left(\log \left({y}^{x}\right) + a\right)}\right) \]
      3. log-pow76.4%

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

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

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

    if -7.80000000000000033e104 < x < 3.6e140

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

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

    if 3.6e140 < 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. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+103} \lor \neg \left(x \leq 2.2 \cdot 10^{+140}\right):\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.50000000000000001e103 or 2.1999999999999998e140 < 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. associate-+l+99.7%

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000001e103 < x < 2.1999999999999998e140

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

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

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

Alternative 8: 71.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;b - 0.5 \leq 4 \cdot 10^{+246}:\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot \log c\\


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

    1. Initial program 99.7%

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

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

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

    if -1.99999999999999984e274 < (-.f64 b 1/2) < 4.00000000000000027e246

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000027e246 < (-.f64 b 1/2)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \log c} \]
    10. Step-by-step derivation
      1. *-commutative82.7%

        \[\leadsto \color{blue}{\log c \cdot b} \]
    11. Simplified82.7%

      \[\leadsto \color{blue}{\log c \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.0%

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

Alternative 9: 73.7% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;b - 0.5 \leq 7 \cdot 10^{+208}:\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\

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


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

    1. Initial program 99.7%

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

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

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

    if -1.99999999999999984e274 < (-.f64 b 1/2) < 7.00000000000000033e208

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

    if 7.00000000000000033e208 < (-.f64 b 1/2)

    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 z around 0 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq -2.15 \cdot 10^{+127}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.5000000000000003e193 or 1.09999999999999996e160 < 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. Add Preprocessing
    3. Taylor expanded in x around inf 72.4%

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

    if -8.5000000000000003e193 < x < -2.14999999999999992e127 or -3.99999999999999975e-49 < x < 1.09999999999999996e160

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.14999999999999992e127 < x < -3.99999999999999975e-49

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+193}:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{+127}:\\ \;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-49}:\\ \;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+160}:\\ \;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+192} \lor \neg \left(x \leq 9 \cdot 10^{+159}\right):\\
\;\;\;\;y \cdot i + x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1999999999999999e192 or 9.00000000000000053e159 < 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. Add Preprocessing
    3. Taylor expanded in x around inf 72.4%

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

    if -1.1999999999999999e192 < x < 9.00000000000000053e159

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 71.8% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+195} \lor \neg \left(x \leq 6.2 \cdot 10^{+235}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.59999999999999991e195 or 6.20000000000000022e235 < x

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999991e195 < x < 6.20000000000000022e235

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 40.5% accurate, 19.6× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.7 \cdot 10^{+119}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7000000000000002e194 or -4.09999999999999996e178 < z < -2.6999999999999998e119

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000002e194 < z < -4.09999999999999996e178

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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 y around inf 45.5%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified45.5%

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

    if -2.6999999999999998e119 < z

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+194}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{+178}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+119}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 67.5% accurate, 24.3× speedup?

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

\\
y \cdot i + \left(z + \left(t + a\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. associate-+l+99.9%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
    1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 20.6% accurate, 30.5× speedup?

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

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

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

\mathbf{elif}\;z \leq -5.6 \cdot 10^{+117}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.75e194 or -3.8999999999999997e178 < z < -5.59999999999999995e117

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

    if -2.75e194 < z < -3.8999999999999997e178

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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 y around inf 45.5%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    7. Simplified45.5%

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

    if -5.59999999999999995e117 < z

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{+194}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{+178}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+117}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 43.8% accurate, 31.0× speedup?

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

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

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


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

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

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

    if -6.99999999999999993e116 < z

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+116}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 20.9% accurate, 71.5× speedup?

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

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

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


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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e119 < z

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+119}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 16.0% 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. associate-+l+99.9%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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-def99.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-def99.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. Step-by-step derivation
    1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{a} \]
  8. Final simplification14.3%

    \[\leadsto a \]
  9. Add Preprocessing

Reproduce

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