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

Percentage Accurate: 99.8% → 99.8%
Time: 13.0s
Alternatives: 16
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 16 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(\left(t + \left(x \cdot \log y + z\right)\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
 (+ (+ (+ (+ t (+ (* x (log y)) z)) 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 (((t + ((x * log(y)) + z)) + 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 = (((t + ((x * log(y)) + z)) + 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 (((t + ((x * Math.log(y)) + z)) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((t + ((x * math.log(y)) + z)) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(t + Float64(Float64(x * log(y)) + z)) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((t + ((x * log(y)) + z)) + a) + ((b - 0.5) * log(c))) + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(t + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $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(t + \left(x \cdot \log y + z\right)\right) + a\right) + \left(b - 0.5\right) \cdot \log c\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(\left(t + \left(x \cdot \log y + z\right)\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  4. Add Preprocessing

Alternative 2: 86.9% accurate, 1.0× speedup?

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

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

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


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

    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 y around 0

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

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

        \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      3. cancel-sign-subN/A

        \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      4. log-recN/A

        \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
      8. sum4-defineN/A

        \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
      9. associate-+r+N/A

        \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
      10. associate-+r+N/A

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

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

    if 2.4e14 < 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. Simplified80.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.4 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \log y + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b + -0.5\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: 78.2% accurate, 1.0× speedup?

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

      1. Initial program 100.0%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\left(x \cdot \log y\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. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \log y\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. log-lowering-log.f6480.2%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\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) \]
      5. Simplified80.2%

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

      if -7.8000000000000002e180 < x < 5.80000000000000007e204

      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.4%

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

        if 5.80000000000000007e204 < x

        1. Initial program 99.8%

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \log y\right), \mathsf{*.f64}\left(\color{blue}{y}, i\right)\right) \]
          2. log-lowering-log.f6492.9%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
        5. Simplified92.9%

          \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
      5. Recombined 3 regimes into one program.
      6. Final simplification76.1%

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

      Alternative 4: 72.6% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+216}:\\ \;\;\;\;y \cdot i + \left(z + t\_1\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{+103}:\\ \;\;\;\;a + \left(\left(z + t\right) + \log c \cdot \left(b + -0.5\right)\right)\\ \mathbf{elif}\;z \leq -9 \cdot 10^{+69}:\\ \;\;\;\;x \cdot \log y + z\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(t\_1 + \left(t + 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 (<= z -3.2e+216)
           (+ (* y i) (+ z t_1))
           (if (<= z -4.7e+103)
             (+ a (+ (+ z t) (* (log c) (+ b -0.5))))
             (if (<= z -9e+69) (+ (* x (log y)) z) (+ (* y i) (+ t_1 (+ t 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 (z <= -3.2e+216) {
      		tmp = (y * i) + (z + t_1);
      	} else if (z <= -4.7e+103) {
      		tmp = a + ((z + t) + (log(c) * (b + -0.5)));
      	} else if (z <= -9e+69) {
      		tmp = (x * log(y)) + z;
      	} else {
      		tmp = (y * i) + (t_1 + (t + a));
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a, b, c, i)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          real(8), intent (in) :: i
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (b - 0.5d0) * log(c)
          if (z <= (-3.2d+216)) then
              tmp = (y * i) + (z + t_1)
          else if (z <= (-4.7d+103)) then
              tmp = a + ((z + t) + (log(c) * (b + (-0.5d0))))
          else if (z <= (-9d+69)) then
              tmp = (x * log(y)) + z
          else
              tmp = (y * i) + (t_1 + (t + a))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (b - 0.5) * Math.log(c);
      	double tmp;
      	if (z <= -3.2e+216) {
      		tmp = (y * i) + (z + t_1);
      	} else if (z <= -4.7e+103) {
      		tmp = a + ((z + t) + (Math.log(c) * (b + -0.5)));
      	} else if (z <= -9e+69) {
      		tmp = (x * Math.log(y)) + z;
      	} else {
      		tmp = (y * i) + (t_1 + (t + a));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b, c, i):
      	t_1 = (b - 0.5) * math.log(c)
      	tmp = 0
      	if z <= -3.2e+216:
      		tmp = (y * i) + (z + t_1)
      	elif z <= -4.7e+103:
      		tmp = a + ((z + t) + (math.log(c) * (b + -0.5)))
      	elif z <= -9e+69:
      		tmp = (x * math.log(y)) + z
      	else:
      		tmp = (y * i) + (t_1 + (t + 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 (z <= -3.2e+216)
      		tmp = Float64(Float64(y * i) + Float64(z + t_1));
      	elseif (z <= -4.7e+103)
      		tmp = Float64(a + Float64(Float64(z + t) + Float64(log(c) * Float64(b + -0.5))));
      	elseif (z <= -9e+69)
      		tmp = Float64(Float64(x * log(y)) + z);
      	else
      		tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(t + 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 (z <= -3.2e+216)
      		tmp = (y * i) + (z + t_1);
      	elseif (z <= -4.7e+103)
      		tmp = a + ((z + t) + (log(c) * (b + -0.5)));
      	elseif (z <= -9e+69)
      		tmp = (x * log(y)) + z;
      	else
      		tmp = (y * i) + (t_1 + (t + 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[z, -3.2e+216], N[(N[(y * i), $MachinePrecision] + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.7e+103], N[(a + N[(N[(z + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e+69], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(b - 0.5\right) \cdot \log c\\
      \mathbf{if}\;z \leq -3.2 \cdot 10^{+216}:\\
      \;\;\;\;y \cdot i + \left(z + t\_1\right)\\
      
      \mathbf{elif}\;z \leq -4.7 \cdot 10^{+103}:\\
      \;\;\;\;a + \left(\left(z + t\right) + \log c \cdot \left(b + -0.5\right)\right)\\
      
      \mathbf{elif}\;z \leq -9 \cdot 10^{+69}:\\
      \;\;\;\;x \cdot \log y + z\\
      
      \mathbf{else}:\\
      \;\;\;\;y \cdot i + \left(t\_1 + \left(t + a\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if z < -3.1999999999999997e216

        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(\color{blue}{z}, \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. Simplified84.3%

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

          if -3.1999999999999997e216 < z < -4.70000000000000033e103

          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 y around 0

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

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

              \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            3. cancel-sign-subN/A

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            4. log-recN/A

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            5. unsub-negN/A

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
            6. mul-1-negN/A

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

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
            8. sum4-defineN/A

              \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
            9. associate-+r+N/A

              \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
            10. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(a, \mathsf{+.f64}\left(\mathsf{+.f64}\left(t, z\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(b + \frac{-1}{2}\right)\right)\right)\right) \]
            9. +-lowering-+.f6491.3%

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

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

          if -4.70000000000000033e103 < z < -8.9999999999999999e69

          1. Initial program 100.0%

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

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

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

              \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            3. cancel-sign-subN/A

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            4. log-recN/A

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            5. unsub-negN/A

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
            6. mul-1-negN/A

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

              \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
            8. sum4-defineN/A

              \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
            9. associate-+r+N/A

              \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
            10. associate-+r+N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{z}, \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right) \]
          7. Step-by-step derivation
            1. Simplified35.1%

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

            if -8.9999999999999999e69 < z

            1. Initial program 99.9%

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{t}, 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. Simplified72.3%

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

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

            Alternative 5: 60.7% accurate, 1.7× speedup?

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

              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(\color{blue}{z}, \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. Simplified84.3%

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

                if -8.50000000000000064e215 < z < -4.70000000000000033e103

                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 y around 0

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

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

                    \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  3. cancel-sign-subN/A

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  4. log-recN/A

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  5. unsub-negN/A

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                  6. mul-1-negN/A

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

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                  8. sum4-defineN/A

                    \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                  9. associate-+r+N/A

                    \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                  10. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(a, \mathsf{+.f64}\left(\mathsf{+.f64}\left(t, z\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(b + \frac{-1}{2}\right)\right)\right)\right) \]
                  9. +-lowering-+.f6491.3%

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

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

                if -4.70000000000000033e103 < z < -8.9999999999999999e69

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  3. cancel-sign-subN/A

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  4. log-recN/A

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  5. unsub-negN/A

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                  6. mul-1-negN/A

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

                    \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                  8. sum4-defineN/A

                    \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                  9. associate-+r+N/A

                    \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                  10. associate-+r+N/A

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

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

                  \[\leadsto \mathsf{+.f64}\left(\color{blue}{z}, \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right) \]
                7. Step-by-step derivation
                  1. Simplified35.1%

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

                  if -8.9999999999999999e69 < 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(\mathsf{+.f64}\left(\color{blue}{a}, \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. Simplified54.0%

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

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

                  Alternative 6: 60.2% accurate, 1.7× speedup?

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

                    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. Simplified78.7%

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

                      if -1.85e219 < z < -5.70000000000000033e103

                      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 y around 0

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

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

                          \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                        3. cancel-sign-subN/A

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                        4. log-recN/A

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                        5. unsub-negN/A

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                        6. mul-1-negN/A

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

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                        8. sum4-defineN/A

                          \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                        9. associate-+r+N/A

                          \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                        10. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(a, \mathsf{+.f64}\left(\mathsf{+.f64}\left(t, z\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), \left(b + \frac{-1}{2}\right)\right)\right)\right) \]
                        9. +-lowering-+.f6491.3%

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

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

                      if -5.70000000000000033e103 < z < -8.9999999999999999e69

                      1. Initial program 100.0%

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

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

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

                          \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                        3. cancel-sign-subN/A

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                        4. log-recN/A

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                        5. unsub-negN/A

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                        6. mul-1-negN/A

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

                          \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                        8. sum4-defineN/A

                          \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                        9. associate-+r+N/A

                          \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                        10. associate-+r+N/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{z}, \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right) \]
                      7. Step-by-step derivation
                        1. Simplified35.1%

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

                        if -8.9999999999999999e69 < 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(\mathsf{+.f64}\left(\color{blue}{a}, \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. Simplified54.0%

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

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

                        Alternative 7: 77.2% accurate, 1.8× speedup?

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

                          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 inf

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

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \log y\right), \mathsf{*.f64}\left(\color{blue}{y}, i\right)\right) \]
                            2. log-lowering-log.f6485.1%

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), \mathsf{*.f64}\left(y, i\right)\right) \]
                          5. Simplified85.1%

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

                          if -8.60000000000000074e177 < x < 3.69999999999999981e205

                          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.4%

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

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

                          Alternative 8: 65.2% accurate, 1.9× speedup?

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

                            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 y around 0

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

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

                                \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                              3. cancel-sign-subN/A

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                              4. log-recN/A

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                              5. unsub-negN/A

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                              6. mul-1-negN/A

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

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                              8. sum4-defineN/A

                                \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                              9. associate-+r+N/A

                                \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                              10. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 400 < y < 2.3e14

                            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 y around 0

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

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

                                \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                              3. cancel-sign-subN/A

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                              4. log-recN/A

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                              5. unsub-negN/A

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                              6. mul-1-negN/A

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

                                \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                              8. sum4-defineN/A

                                \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                              9. associate-+r+N/A

                                \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                              10. associate-+r+N/A

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

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

                              \[\leadsto \mathsf{+.f64}\left(\color{blue}{a}, \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right) \]
                            7. Step-by-step derivation
                              1. Simplified75.1%

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

                              if 2.3e14 < 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(\color{blue}{z}, \mathsf{*.f64}\left(y, i\right)\right) \]
                              4. Step-by-step derivation
                                1. Simplified63.8%

                                  \[\leadsto \color{blue}{z} + y \cdot i \]
                              5. Recombined 3 regimes into one program.
                              6. Final simplification70.1%

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

                              Alternative 9: 56.2% accurate, 1.9× speedup?

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

                                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. Simplified58.0%

                                    \[\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. associate-+r+N/A

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

                                      \[\leadsto \log c \cdot \left(b - \frac{1}{2}\right) + \color{blue}{\left(a + z\right)} \]
                                    3. +-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) \]
                                    4. *-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) \]
                                    5. 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) \]
                                    6. 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) \]
                                    7. 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) \]
                                    8. +-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) \]
                                    9. +-lowering-+.f6455.9%

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

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

                                  if 400 < y < 2.65e14

                                  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 y around 0

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

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

                                      \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    3. cancel-sign-subN/A

                                      \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    4. log-recN/A

                                      \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    5. unsub-negN/A

                                      \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                                    6. mul-1-negN/A

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

                                      \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                                    8. sum4-defineN/A

                                      \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                                    9. associate-+r+N/A

                                      \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                                    10. associate-+r+N/A

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

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

                                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{a}, \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right) \]
                                  7. Step-by-step derivation
                                    1. Simplified75.1%

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

                                    if 2.65e14 < 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(\color{blue}{z}, \mathsf{*.f64}\left(y, i\right)\right) \]
                                    4. Step-by-step derivation
                                      1. Simplified63.8%

                                        \[\leadsto \color{blue}{z} + y \cdot i \]
                                    5. Recombined 3 regimes into one program.
                                    6. Final simplification59.9%

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

                                    Alternative 10: 54.9% accurate, 1.9× speedup?

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

                                      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. Simplified58.0%

                                          \[\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. associate-+r+N/A

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

                                            \[\leadsto \log c \cdot \left(b - \frac{1}{2}\right) + \color{blue}{\left(a + z\right)} \]
                                          3. +-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) \]
                                          4. *-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) \]
                                          5. 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) \]
                                          6. 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) \]
                                          7. 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) \]
                                          8. +-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) \]
                                          9. +-lowering-+.f6455.9%

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

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

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

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

                                            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\log c, b\right), \mathsf{+.f64}\left(\color{blue}{a}, z\right)\right) \]
                                          3. log-lowering-log.f6452.9%

                                            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(c\right), b\right), \mathsf{+.f64}\left(a, z\right)\right) \]
                                        7. Simplified52.9%

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

                                        if 400 < y < 4.1e14

                                        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 y around 0

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

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

                                            \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                          3. cancel-sign-subN/A

                                            \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                          4. log-recN/A

                                            \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                          5. unsub-negN/A

                                            \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                                          6. mul-1-negN/A

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

                                            \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                                          8. sum4-defineN/A

                                            \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                                          9. associate-+r+N/A

                                            \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                                          10. associate-+r+N/A

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

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

                                          \[\leadsto \mathsf{+.f64}\left(\color{blue}{a}, \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right) \]
                                        7. Step-by-step derivation
                                          1. Simplified75.1%

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

                                          if 4.1e14 < 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(\color{blue}{z}, \mathsf{*.f64}\left(y, i\right)\right) \]
                                          4. Step-by-step derivation
                                            1. Simplified63.8%

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

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

                                          Alternative 11: 43.7% accurate, 1.9× speedup?

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

                                            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. Simplified58.1%

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

                                              if -1.03999999999999995e117 < z < -4.39999999999999974e68

                                              1. Initial program 100.0%

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

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

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

                                                  \[\leadsto \mathsf{sum4}\left(a, \color{blue}{t}, z, \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                                3. cancel-sign-subN/A

                                                  \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \left(\mathsf{neg}\left(\log c\right)\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                                4. log-recN/A

                                                  \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y - \log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                                5. unsub-negN/A

                                                  \[\leadsto \mathsf{sum4}\left(a, t, z, \left(x \cdot \log y + \left(\mathsf{neg}\left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
                                                6. mul-1-negN/A

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

                                                  \[\leadsto \mathsf{sum4}\left(a, t, z, \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right) \]
                                                8. sum4-defineN/A

                                                  \[\leadsto \left(a + t\right) + \color{blue}{\left(z + \left(-1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right) + x \cdot \log y\right)\right)} \]
                                                9. associate-+r+N/A

                                                  \[\leadsto \left(a + t\right) + \left(\left(z + -1 \cdot \left(\log \left(\frac{1}{c}\right) \cdot \left(b - \frac{1}{2}\right)\right)\right) + \color{blue}{x \cdot \log y}\right) \]
                                                10. associate-+r+N/A

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

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

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

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

                                                if -4.39999999999999974e68 < 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. Simplified40.4%

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

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{+117}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{+68}:\\ \;\;\;\;x \cdot \log y + a\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
                                                7. Add Preprocessing

                                                Alternative 12: 22.4% accurate, 16.8× speedup?

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

                                                  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. Simplified13.6%

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

                                                    if 4.49999999999999999e-68 < a < 1.49999999999999993e100

                                                    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 y around inf

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

                                                        \[\leadsto \mathsf{*.f64}\left(i, \color{blue}{y}\right) \]
                                                    5. Simplified26.5%

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

                                                    if 1.49999999999999993e100 < a

                                                    1. Initial program 100.0%

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

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

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

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

                                                    Alternative 13: 44.0% accurate, 21.9× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+117}:\\ \;\;\;\;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 -1.2e+117) (+ 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 <= -1.2e+117) {
                                                    		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 <= (-1.2d+117)) 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 <= -1.2e+117) {
                                                    		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 <= -1.2e+117:
                                                    		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 <= -1.2e+117)
                                                    		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 <= -1.2e+117)
                                                    		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, -1.2e+117], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;z \leq -1.2 \cdot 10^{+117}:\\
                                                    \;\;\;\;z + y \cdot i\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;a + y \cdot i\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if z < -1.1999999999999999e117

                                                      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. Simplified58.1%

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

                                                        if -1.1999999999999999e117 < 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. Simplified41.1%

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

                                                        Alternative 14: 41.4% accurate, 21.9× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+140}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
                                                        (FPCore (x y z t a b c i)
                                                         :precision binary64
                                                         (if (<= z -8.5e+140) 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 <= -8.5e+140) {
                                                        		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 <= (-8.5d+140)) 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 <= -8.5e+140) {
                                                        		tmp = z;
                                                        	} else {
                                                        		tmp = a + (y * i);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(x, y, z, t, a, b, c, i):
                                                        	tmp = 0
                                                        	if z <= -8.5e+140:
                                                        		tmp = z
                                                        	else:
                                                        		tmp = a + (y * i)
                                                        	return tmp
                                                        
                                                        function code(x, y, z, t, a, b, c, i)
                                                        	tmp = 0.0
                                                        	if (z <= -8.5e+140)
                                                        		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 <= -8.5e+140)
                                                        		tmp = z;
                                                        	else
                                                        		tmp = a + (y * i);
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -8.5e+140], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;z \leq -8.5 \cdot 10^{+140}:\\
                                                        \;\;\;\;z\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;a + y \cdot i\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if z < -8.4999999999999996e140

                                                          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. Simplified44.7%

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

                                                            if -8.4999999999999996e140 < 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. Simplified40.5%

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

                                                            Alternative 15: 20.6% accurate, 36.4× speedup?

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

                                                              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. Simplified15.0%

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

                                                                if 1.22e56 < a

                                                                1. Initial program 100.0%

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

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

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

                                                                Alternative 16: 16.7% accurate, 219.0× speedup?

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

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

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

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

                                                                  Reproduce

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