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

Percentage Accurate: 99.8% → 99.8%
Time: 12.1s
Alternatives: 10
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 10 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, 1.0× speedup?

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

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

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

Alternative 2: 92.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+138}:\\
\;\;\;\;y \cdot i + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.99999999999999993e109

    1. Initial program 99.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{z}, t\right), a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
    4. Step-by-step derivation
      1. Simplified92.2%

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

      if -3.99999999999999993e109 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e138

      1. Initial program 99.9%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot \left(t \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
      4. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        3. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        4. distribute-lft-inN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right) + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot t\right) \cdot -1\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(t \cdot -1\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(-1 \cdot t\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        8. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot -1\right) \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(1 \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        10. *-lft-identityN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        11. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(t \cdot -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(-1 \cdot t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        13. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot -1\right) \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        14. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + 1 \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        15. *-lft-identityN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        16. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right), t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
      5. Simplified76.3%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \color{blue}{\left(b \cdot \log c\right)}\right), \mathsf{*.f64}\left(y, i\right)\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \left(\log c \cdot b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\log c, b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        3. log-lowering-log.f6474.8%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
      8. Simplified74.8%

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

        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)}, \mathsf{*.f64}\left(y, i\right)\right) \]
      10. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \left(t + \left(z + x \cdot \log y\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, i\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \left(z + x \cdot \log y\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \left(x \cdot \log y + z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\left(x \cdot \log y\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        6. log-lowering-log.f6498.4%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
      11. Simplified98.4%

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

      if 1e138 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

      1. Initial program 99.7%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{z}, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
      4. Step-by-step derivation
        1. Simplified82.0%

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

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

      Alternative 3: 90.6% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ t_2 := y \cdot i + \left(t\_1 + \left(z + a\right)\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+109}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+138}:\\ \;\;\;\;y \cdot i + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (let* ((t_1 (* (- b 0.5) (log c))) (t_2 (+ (* y i) (+ t_1 (+ z a)))))
         (if (<= t_1 -4e+109)
           t_2
           (if (<= t_1 1e+138) (+ (* y i) (+ a (+ (+ (* x (log y)) z) t))) t_2))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (b - 0.5) * log(c);
      	double t_2 = (y * i) + (t_1 + (z + a));
      	double tmp;
      	if (t_1 <= -4e+109) {
      		tmp = t_2;
      	} else if (t_1 <= 1e+138) {
      		tmp = (y * i) + (a + (((x * log(y)) + z) + t));
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a, b, c, i)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          real(8), intent (in) :: i
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = (b - 0.5d0) * log(c)
          t_2 = (y * i) + (t_1 + (z + a))
          if (t_1 <= (-4d+109)) then
              tmp = t_2
          else if (t_1 <= 1d+138) then
              tmp = (y * i) + (a + (((x * log(y)) + z) + t))
          else
              tmp = t_2
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (b - 0.5) * Math.log(c);
      	double t_2 = (y * i) + (t_1 + (z + a));
      	double tmp;
      	if (t_1 <= -4e+109) {
      		tmp = t_2;
      	} else if (t_1 <= 1e+138) {
      		tmp = (y * i) + (a + (((x * Math.log(y)) + z) + t));
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b, c, i):
      	t_1 = (b - 0.5) * math.log(c)
      	t_2 = (y * i) + (t_1 + (z + a))
      	tmp = 0
      	if t_1 <= -4e+109:
      		tmp = t_2
      	elif t_1 <= 1e+138:
      		tmp = (y * i) + (a + (((x * math.log(y)) + z) + t))
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t, a, b, c, i)
      	t_1 = Float64(Float64(b - 0.5) * log(c))
      	t_2 = Float64(Float64(y * i) + Float64(t_1 + Float64(z + a)))
      	tmp = 0.0
      	if (t_1 <= -4e+109)
      		tmp = t_2;
      	elseif (t_1 <= 1e+138)
      		tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(x * log(y)) + z) + t)));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b, c, i)
      	t_1 = (b - 0.5) * log(c);
      	t_2 = (y * i) + (t_1 + (z + a));
      	tmp = 0.0;
      	if (t_1 <= -4e+109)
      		tmp = t_2;
      	elseif (t_1 <= 1e+138)
      		tmp = (y * i) + (a + (((x * log(y)) + z) + t));
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+109], t$95$2, If[LessEqual[t$95$1, 1e+138], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(b - 0.5\right) \cdot \log c\\
      t_2 := y \cdot i + \left(t\_1 + \left(z + a\right)\right)\\
      \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+109}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq 10^{+138}:\\
      \;\;\;\;y \cdot i + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.99999999999999993e109 or 1e138 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

        1. Initial program 99.8%

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{z}, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        4. Step-by-step derivation
          1. Simplified80.5%

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

          if -3.99999999999999993e109 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e138

          1. Initial program 99.9%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot \left(t \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            4. distribute-lft-inN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right) + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            5. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot t\right) \cdot -1\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            6. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(t \cdot -1\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(-1 \cdot t\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            8. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot -1\right) \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(1 \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            10. *-lft-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            11. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(t \cdot -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(-1 \cdot t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            13. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot -1\right) \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            14. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + 1 \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            15. *-lft-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            16. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right), t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          5. Simplified76.3%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \color{blue}{\left(b \cdot \log c\right)}\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \left(\log c \cdot b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\log c, b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. log-lowering-log.f6474.8%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          8. Simplified74.8%

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

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)}, \mathsf{*.f64}\left(y, i\right)\right) \]
          10. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \left(t + \left(z + x \cdot \log y\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, i\right)\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \left(z + x \cdot \log y\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \left(x \cdot \log y + z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            4. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\left(x \cdot \log y\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            6. log-lowering-log.f6498.4%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          11. Simplified98.4%

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

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

        Alternative 4: 86.4% accurate, 1.0× speedup?

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

          1. Initial program 99.9%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot \left(t \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            4. distribute-lft-inN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right) + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            5. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot t\right) \cdot -1\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            6. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(t \cdot -1\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(-1 \cdot t\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            8. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot -1\right) \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(1 \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            10. *-lft-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            11. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(t \cdot -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(-1 \cdot t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            13. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot -1\right) \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            14. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + 1 \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            15. *-lft-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            16. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right), t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          5. Simplified76.6%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \color{blue}{\left(b \cdot \log c\right)}\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \left(\log c \cdot b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\log c, b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. log-lowering-log.f6475.3%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          8. Simplified75.3%

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

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)}, \mathsf{*.f64}\left(y, i\right)\right) \]
          10. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \left(t + \left(z + x \cdot \log y\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, i\right)\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \left(z + x \cdot \log y\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \left(x \cdot \log y + z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            4. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\left(x \cdot \log y\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            6. log-lowering-log.f6494.3%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          11. Simplified94.3%

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

          if 1e138 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

          1. Initial program 99.7%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot \left(t \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            4. distribute-lft-inN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right) + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            5. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot t\right) \cdot -1\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            6. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(t \cdot -1\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(-1 \cdot t\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            8. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot -1\right) \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(1 \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            10. *-lft-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            11. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(t \cdot -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(-1 \cdot t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            13. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot -1\right) \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            14. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + 1 \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            15. *-lft-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            16. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right), t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          5. Simplified75.6%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \color{blue}{\left(b \cdot \log c\right)}\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \left(\log c \cdot b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\log c, b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            3. log-lowering-log.f6475.6%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          8. Simplified75.6%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{z}, t\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
          10. Step-by-step derivation
            1. Simplified85.0%

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

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

          Alternative 5: 60.9% accurate, 1.9× speedup?

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

            1. Initial program 99.8%

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{z}, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
            4. Step-by-step derivation
              1. Simplified62.5%

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

                \[\leadsto \color{blue}{a + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
              3. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right) + \color{blue}{a} \]
                2. +-commutativeN/A

                  \[\leadsto \left(\log c \cdot \left(b - \frac{1}{2}\right) + z\right) + a \]
                3. associate-+l+N/A

                  \[\leadsto \log c \cdot \left(b - \frac{1}{2}\right) + \color{blue}{\left(z + a\right)} \]
                4. +-commutativeN/A

                  \[\leadsto \log c \cdot \left(b - \frac{1}{2}\right) + \left(a + \color{blue}{z}\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\log c \cdot \left(b - \frac{1}{2}\right)\right), \color{blue}{\left(a + z\right)}\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\log c, \left(b - \frac{1}{2}\right)\right), \left(\color{blue}{a} + z\right)\right) \]
                7. log-lowering-log.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(b - \frac{1}{2}\right)\right), \left(a + z\right)\right) \]
                8. sub-negN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right), \left(a + z\right)\right) \]
                9. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(b + \frac{-1}{2}\right)\right), \left(a + z\right)\right) \]
                10. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{+.f64}\left(b, \frac{-1}{2}\right)\right), \left(a + z\right)\right) \]
                11. +-lowering-+.f6461.5%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{+.f64}\left(b, \frac{-1}{2}\right)\right), \mathsf{+.f64}\left(a, \color{blue}{z}\right)\right) \]
              4. Simplified61.5%

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

              if 5.6999999999999997e-11 < 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. Add Preprocessing
              3. Taylor expanded in z around inf

                \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{z}, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
              4. Step-by-step derivation
                1. Simplified73.5%

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

                  \[\leadsto \color{blue}{y \cdot \left(i + \left(\frac{a}{y} + \left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right)\right)\right)} \]
                3. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(i + \left(\frac{a}{y} + \left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right)\right)\right)}\right) \]
                  2. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(y, \left(\left(\frac{a}{y} + \left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right)\right) + \color{blue}{i}\right)\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(y, \left(\left(\left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right) + \frac{a}{y}\right) + i\right)\right) \]
                  4. associate-+l+N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \left(\left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right) + \color{blue}{\left(\frac{a}{y} + i\right)}\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right), \color{blue}{\left(\frac{a}{y} + i\right)}\right)\right) \]
                  6. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(\frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y} + \frac{z}{y}\right), \left(\color{blue}{\frac{a}{y}} + i\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right), \left(\frac{z}{y}\right)\right), \left(\color{blue}{\frac{a}{y}} + i\right)\right)\right) \]
                  8. associate-/l*N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\log c \cdot \frac{b - \frac{1}{2}}{y}\right), \left(\frac{z}{y}\right)\right), \left(\frac{\color{blue}{a}}{y} + i\right)\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log c, \left(\frac{b - \frac{1}{2}}{y}\right)\right), \left(\frac{z}{y}\right)\right), \left(\frac{\color{blue}{a}}{y} + i\right)\right)\right) \]
                  10. log-lowering-log.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(\frac{b - \frac{1}{2}}{y}\right)\right), \left(\frac{z}{y}\right)\right), \left(\frac{a}{y} + i\right)\right)\right) \]
                  11. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\left(b - \frac{1}{2}\right), y\right)\right), \left(\frac{z}{y}\right)\right), \left(\frac{a}{y} + i\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\left(b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), y\right)\right), \left(\frac{z}{y}\right)\right), \left(\frac{a}{y} + i\right)\right)\right) \]
                  13. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\left(b + \frac{-1}{2}\right), y\right)\right), \left(\frac{z}{y}\right)\right), \left(\frac{a}{y} + i\right)\right)\right) \]
                  14. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(b, \frac{-1}{2}\right), y\right)\right), \left(\frac{z}{y}\right)\right), \left(\frac{a}{y} + i\right)\right)\right) \]
                  15. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(b, \frac{-1}{2}\right), y\right)\right), \mathsf{/.f64}\left(z, y\right)\right), \left(\frac{a}{\color{blue}{y}} + i\right)\right)\right) \]
                  16. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(b, \frac{-1}{2}\right), y\right)\right), \mathsf{/.f64}\left(z, y\right)\right), \mathsf{+.f64}\left(\left(\frac{a}{y}\right), \color{blue}{i}\right)\right)\right) \]
                  17. /-lowering-/.f6473.5%

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(b, \frac{-1}{2}\right), y\right)\right), \mathsf{/.f64}\left(z, y\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(a, y\right), i\right)\right)\right) \]
                4. Simplified73.5%

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

                  \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\color{blue}{\left(\frac{z}{y}\right)}, \mathsf{+.f64}\left(\mathsf{/.f64}\left(a, y\right), i\right)\right)\right) \]
                6. Step-by-step derivation
                  1. /-lowering-/.f6466.1%

                    \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(z, y\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{/.f64}\left(a, y\right)}, i\right)\right)\right) \]
                7. Simplified66.1%

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

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

              Alternative 6: 44.5% accurate, 18.2× speedup?

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

                1. Initial program 99.9%

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot \left(t \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} - 1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  2. sub-negN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  3. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  4. distribute-lft-inN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot t\right) \cdot \left(-1 \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right) + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  5. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot t\right) \cdot -1\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(t \cdot -1\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(-1 \cdot \left(-1 \cdot t\right)\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  8. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(-1 \cdot -1\right) \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(1 \cdot t\right) \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  10. *-lft-identityN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot t\right) \cdot -1\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  11. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(t \cdot -1\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + -1 \cdot \left(-1 \cdot t\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  13. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + \left(-1 \cdot -1\right) \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  14. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + 1 \cdot t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  15. *-lft-identityN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t} + t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  16. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(t \cdot \frac{a + \left(z + x \cdot \log y\right)}{t}\right), t\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(c\right)\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                5. Simplified71.8%

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \color{blue}{\left(b \cdot \log c\right)}\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \left(\log c \cdot b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\log c, b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                  3. log-lowering-log.f6471.8%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(t, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{+.f64}\left(a, z\right)\right), t\right)\right), t\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                8. Simplified71.8%

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(t + z\right)}, \mathsf{*.f64}\left(y, i\right)\right) \]
                  3. Step-by-step derivation
                    1. +-lowering-+.f6470.0%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(t, z\right), \mathsf{*.f64}\left(\color{blue}{y}, i\right)\right) \]
                  4. Simplified70.0%

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

                  if -3.99999999999999981e74 < z

                  1. Initial program 99.9%

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

                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{a}, \mathsf{*.f64}\left(y, i\right)\right) \]
                  4. Step-by-step derivation
                    1. Simplified44.4%

                      \[\leadsto \color{blue}{a} + y \cdot i \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification50.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+74}:\\ \;\;\;\;y \cdot i + \left(z + t\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 7: 42.8% accurate, 21.9× speedup?

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

                    1. Initial program 99.9%

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

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{z}, \mathsf{*.f64}\left(y, i\right)\right) \]
                    4. Step-by-step derivation
                      1. Simplified56.9%

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

                      if -2.19999999999999995e71 < z

                      1. Initial program 99.9%

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

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{a}, \mathsf{*.f64}\left(y, i\right)\right) \]
                      4. Step-by-step derivation
                        1. Simplified44.2%

                          \[\leadsto \color{blue}{a} + y \cdot i \]
                      5. Recombined 2 regimes into one program.
                      6. Add Preprocessing

                      Alternative 8: 41.0% accurate, 21.9× speedup?

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

                        1. Initial program 99.8%

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

                          \[\leadsto \color{blue}{z} \]
                        4. Step-by-step derivation
                          1. Simplified46.3%

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

                          if -2.80000000000000006e182 < z

                          1. Initial program 99.9%

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

                            \[\leadsto \mathsf{+.f64}\left(\color{blue}{a}, \mathsf{*.f64}\left(y, i\right)\right) \]
                          4. Step-by-step derivation
                            1. Simplified42.2%

                              \[\leadsto \color{blue}{a} + y \cdot i \]
                          5. Recombined 2 regimes into one program.
                          6. Add Preprocessing

                          Alternative 9: 20.8% accurate, 36.4× speedup?

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

                            1. Initial program 99.9%

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

                              \[\leadsto \color{blue}{z} \]
                            4. Step-by-step derivation
                              1. Simplified38.4%

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

                              if -2.0500000000000001e70 < z

                              1. Initial program 99.9%

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

                                \[\leadsto \color{blue}{a} \]
                              4. Step-by-step derivation
                                1. Simplified23.4%

                                  \[\leadsto \color{blue}{a} \]
                              5. Recombined 2 regimes into one program.
                              6. Add Preprocessing

                              Alternative 10: 16.3% 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. Add Preprocessing
                              3. Taylor expanded in a around inf

                                \[\leadsto \color{blue}{a} \]
                              4. Step-by-step derivation
                                1. Simplified20.6%

                                  \[\leadsto \color{blue}{a} \]
                                2. Add Preprocessing

                                Reproduce

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