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

Percentage Accurate: 99.8% → 99.8%
Time: 22.1s
Alternatives: 17
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 17 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.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.50000000000000046e-54 < y

    1. Initial program 99.9%

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 4: 94.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -1.7500000000000001e151 < x < 1.5e9

    1. Initial program 99.9%

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

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

    if 1.5e9 < 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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y + \left(\left(z + t\right) + \color{blue}{a}\right)\right) \]
    7. Step-by-step derivation
      1. fma-udef90.8%

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

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

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

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

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

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

Alternative 5: 94.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999985e150 < x < 5.8e7

    1. Initial program 99.9%

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

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

    if 5.8e7 < 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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y + \left(\left(z + t\right) + \color{blue}{a}\right)\right) \]
    7. Step-by-step derivation
      1. fma-udef90.8%

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

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

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

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

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

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

Alternative 6: 90.4% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

    if -4.99999999999999994e203 < (-.f64 b 1/2) < 2.00000000000000003e122

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 7: 94.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+150} \lor \neg \left(x \leq 1700000\right):\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(x \cdot \log y + z\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.09999999999999998e150 or 1.7e6 < x

    1. Initial program 99.8%

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

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

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

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

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

    if -2.09999999999999998e150 < x < 1.7e6

    1. Initial program 99.9%

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

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

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

Alternative 8: 92.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+150} \lor \neg \left(x \leq 1820000000\right):\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(x \cdot \log y + z\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.40000000000000003e150 or 1.82e9 < x

    1. Initial program 99.8%

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

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

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

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

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

    if -2.40000000000000003e150 < x < 1.82e9

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 9: 77.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+156} \lor \neg \left(x \leq 1.75 \cdot 10^{+168}\right):\\
\;\;\;\;t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.80000000000000021e156 or 1.7500000000000001e168 < 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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000021e156 < x < 1.7500000000000001e168

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 66.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+156} \lor \neg \left(x \leq 1.46 \cdot 10^{+168}\right):\\
\;\;\;\;t + \left(z + \left(x \cdot \log y + y \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.20000000000000037e156 or 1.45999999999999996e168 < 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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000037e156 < x < 1.45999999999999996e168

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

Alternative 11: 73.9% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5999999999999996e122 < z

    1. Initial program 99.9%

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

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

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

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

Alternative 12: 22.5% accurate, 19.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.5 \cdot 10^{-162}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-44}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 105000000:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{+145}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 8.49999999999999955e-162 or 3.40000000000000016e-44 < a < 1.05e8

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999955e-162 < a < 3.40000000000000016e-44 or 1.05e8 < a < 1.3999999999999999e145

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    6. Simplified35.6%

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

    if 1.3999999999999999e145 < a

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-44}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 105000000:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{+145}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 13: 40.3% accurate, 19.5× speedup?

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

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

\mathbf{elif}\;z \leq -2.3 \cdot 10^{+188} \lor \neg \left(z \leq -1.5 \cdot 10^{+165}\right):\\
\;\;\;\;a + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.0000000000000002e214 or -2.30000000000000011e188 < z < -1.49999999999999995e165

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.0000000000000002e214 < z < -2.30000000000000011e188 or -1.49999999999999995e165 < z

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+214}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+188} \lor \neg \left(z \leq -1.5 \cdot 10^{+165}\right):\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 14: 66.8% accurate, 24.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 20.6% accurate, 30.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 32000000000000:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{+103}:\\
\;\;\;\;a\\

\mathbf{elif}\;a \leq 2.2 \cdot 10^{+176}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 3.2e13 or 9.49999999999999922e103 < a < 2.20000000000000007e176

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e13 < a < 9.49999999999999922e103 or 2.20000000000000007e176 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 32000000000000:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+103}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+176}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 16: 54.1% accurate, 31.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{+90}:\\
\;\;\;\;z + \left(t + a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.60000000000000016e90

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.60000000000000016e90 < y

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.6 \cdot 10^{+90}:\\ \;\;\;\;z + \left(t + a\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 17: 15.8% accurate, 219.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{a} \]
  8. Final simplification16.9%

    \[\leadsto a \]

Reproduce

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