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

Percentage Accurate: 99.7% → 99.7%
Time: 7.2s
Alternatives: 17
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.7% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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.7% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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}
Derivation
  1. Initial program 99.7%

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

Alternative 2: 92.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;\left(\left(\left(\left(t\_1 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq 200:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, t\_1 + a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= (+ (+ (+ (+ (+ t_1 z) t) a) (* (- b 0.5) (log c))) (* y i)) 200.0)
     (+ (+ (fma i y (fma (log c) (- b 0.5) (* (log y) x))) z) t)
     (fma y i (fma b (log c) (+ t_1 a))))))
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 tmp;
	if ((((((t_1 + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= 200.0) {
		tmp = (fma(i, y, fma(log(c), (b - 0.5), (log(y) * x))) + z) + t;
	} else {
		tmp = fma(y, i, fma(b, log(c), (t_1 + a)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(Float64(t_1 + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= 200.0)
		tmp = Float64(Float64(fma(i, y, fma(log(c), Float64(b - 0.5), Float64(log(y) * x))) + z) + t);
	else
		tmp = fma(y, i, fma(b, log(c), Float64(t_1 + a)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(t$95$1 + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], 200.0], N[(N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision], N[(y * i + N[(b * N[Log[c], $MachinePrecision] + N[(t$95$1 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;\left(\left(\left(\left(t\_1 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq 200:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
      4. lower-+.f64N/A

        \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
      5. lower-fma.f64N/A

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
      9. lift--.f64N/A

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
      11. lower-*.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
      12. lift-log.f6484.3

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites84.3%

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

    if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      5. lower-fma.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      6. lower-/.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      7. lift-log.f6488.3

        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    4. Applied rewrites88.3%

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

      \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
    6. Step-by-step derivation
      1. Applied rewrites87.5%

        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
        4. lower-fma.f6487.5

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
        5. lift-+.f64N/A

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

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

          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
        8. lift-log.f64N/A

          \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b, \log c, \left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)}\right) \]
      3. Applied rewrites87.5%

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{x \cdot \log y} + a\right)\right) \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, x \cdot \color{blue}{\log y} + a\right)\right) \]
        2. lift-log.f6470.1

          \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, x \cdot \log y + a\right)\right) \]
      6. Applied rewrites70.1%

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{x \cdot \log y} + a\right)\right) \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 3: 79.9% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t\\ \mathbf{if}\;x \leq -2.05 \cdot 10^{+165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(\log c, b - 0.5, i \cdot y\right) + z\right) + t\right) + a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (+ (+ (fma i y (* x (log y))) z) t)))
       (if (<= x -2.05e+165)
         t_1
         (if (<= x 7.4e+158)
           (+ (+ (+ (fma (log c) (- b 0.5) (* i y)) z) t) a)
           t_1))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = (fma(i, y, (x * log(y))) + z) + t;
    	double tmp;
    	if (x <= -2.05e+165) {
    		tmp = t_1;
    	} else if (x <= 7.4e+158) {
    		tmp = ((fma(log(c), (b - 0.5), (i * y)) + z) + t) + a;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(Float64(fma(i, y, Float64(x * log(y))) + z) + t)
    	tmp = 0.0
    	if (x <= -2.05e+165)
    		tmp = t_1;
    	elseif (x <= 7.4e+158)
    		tmp = Float64(Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(i * y)) + z) + t) + a);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * y + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[x, -2.05e+165], t$95$1, If[LessEqual[x, 7.4e+158], N[(N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t\\
    \mathbf{if}\;x \leq -2.05 \cdot 10^{+165}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\
    \;\;\;\;\left(\left(\mathsf{fma}\left(\log c, b - 0.5, i \cdot y\right) + z\right) + t\right) + a\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.0500000000000001e165 or 7.40000000000000021e158 < x

      1. Initial program 99.4%

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

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

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

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

          \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
        4. lower-+.f64N/A

          \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
        5. lower-fma.f64N/A

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

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

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
        9. lift--.f64N/A

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
        11. lower-*.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
        12. lift-log.f6491.3

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
      4. Applied rewrites91.3%

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
        2. lift-log.f6483.3

          \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
      7. Applied rewrites83.3%

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

      if -2.0500000000000001e165 < x < 7.40000000000000021e158

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto \left(\left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + t\right) + a \]
        4. lower-+.f64N/A

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

          \[\leadsto \left(\left(\left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right) + z\right) + t\right) + a \]
        6. lower-+.f64N/A

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

          \[\leadsto \left(\left(\left(\log c \cdot \left(b - \frac{1}{2}\right) + i \cdot y\right) + z\right) + t\right) + a \]
        8. lower-fma.f64N/A

          \[\leadsto \left(\left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, i \cdot y\right) + z\right) + t\right) + a \]
        9. lift-log.f64N/A

          \[\leadsto \left(\left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, i \cdot y\right) + z\right) + t\right) + a \]
        10. lift--.f64N/A

          \[\leadsto \left(\left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, i \cdot y\right) + z\right) + t\right) + a \]
        11. lower-*.f6495.9

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

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

    Alternative 4: 78.5% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t\\ \mathbf{if}\;x \leq -2.05 \cdot 10^{+165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\ \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (+ (+ (fma i y (* x (log y))) z) t)))
       (if (<= x -2.05e+165)
         t_1
         (if (<= x 7.4e+158) (+ (+ (+ z a) (* (- b 0.5) (log c))) (* y i)) t_1))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = (fma(i, y, (x * log(y))) + z) + t;
    	double tmp;
    	if (x <= -2.05e+165) {
    		tmp = t_1;
    	} else if (x <= 7.4e+158) {
    		tmp = ((z + a) + ((b - 0.5) * log(c))) + (y * i);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(Float64(fma(i, y, Float64(x * log(y))) + z) + t)
    	tmp = 0.0
    	if (x <= -2.05e+165)
    		tmp = t_1;
    	elseif (x <= 7.4e+158)
    		tmp = Float64(Float64(Float64(z + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * y + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[x, -2.05e+165], t$95$1, If[LessEqual[x, 7.4e+158], N[(N[(N[(z + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t\\
    \mathbf{if}\;x \leq -2.05 \cdot 10^{+165}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\
    \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.0500000000000001e165 or 7.40000000000000021e158 < x

      1. Initial program 99.4%

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

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

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

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

          \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
        4. lower-+.f64N/A

          \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
        5. lower-fma.f64N/A

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

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

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
        9. lift--.f64N/A

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
        11. lower-*.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
        12. lift-log.f6491.3

          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
      4. Applied rewrites91.3%

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
        2. lift-log.f6483.3

          \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
      7. Applied rewrites83.3%

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

      if -2.0500000000000001e165 < x < 7.40000000000000021e158

      1. Initial program 99.8%

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

        \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      3. Step-by-step derivation
        1. Applied rewrites78.9%

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

      Alternative 5: 77.2% accurate, 1.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t\\ \mathbf{if}\;x \leq -1.55 \cdot 10^{+165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, 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 (+ (+ (fma i y (* x (log y))) z) t)))
         (if (<= x -1.55e+165)
           t_1
           (if (<= x 7.4e+158) (fma y i (fma b (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 = (fma(i, y, (x * log(y))) + z) + t;
      	double tmp;
      	if (x <= -1.55e+165) {
      		tmp = t_1;
      	} else if (x <= 7.4e+158) {
      		tmp = fma(y, i, fma(b, log(c), (z + a)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b, c, i)
      	t_1 = Float64(Float64(fma(i, y, Float64(x * log(y))) + z) + t)
      	tmp = 0.0
      	if (x <= -1.55e+165)
      		tmp = t_1;
      	elseif (x <= 7.4e+158)
      		tmp = fma(y, i, fma(b, log(c), Float64(z + a)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * y + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[x, -1.55e+165], t$95$1, If[LessEqual[x, 7.4e+158], N[(y * i + N[(b * N[Log[c], $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t\\
      \mathbf{if}\;x \leq -1.55 \cdot 10^{+165}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\
      \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, z + a\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -1.5500000000000001e165 or 7.40000000000000021e158 < x

        1. Initial program 99.4%

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

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

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

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

            \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
          4. lower-+.f64N/A

            \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
          5. lower-fma.f64N/A

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

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

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

            \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
          9. lift--.f64N/A

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

            \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
          11. lower-*.f64N/A

            \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
          12. lift-log.f6491.3

            \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
        4. Applied rewrites91.3%

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

          \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
          2. lift-log.f6483.3

            \[\leadsto \left(\mathsf{fma}\left(i, y, x \cdot \log y\right) + z\right) + t \]
        7. Applied rewrites83.3%

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

        if -1.5500000000000001e165 < x < 7.40000000000000021e158

        1. Initial program 99.8%

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

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

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

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

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

            \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
          5. lower-fma.f64N/A

            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
          6. lower-/.f64N/A

            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
          7. lift-log.f6495.9

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

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

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

            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
            3. lift-*.f64N/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
            5. lift-+.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
            8. lift-log.f64N/A

              \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
            9. lower-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{z} + a\right)\right) \]
          5. Step-by-step derivation
            1. Applied rewrites77.1%

              \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{z} + a\right)\right) \]
          6. Recombined 2 regimes into one program.
          7. Add Preprocessing

          Alternative 6: 75.1% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\ \mathbf{if}\;x \leq -3 \cdot 10^{+186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, 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 (fma y i (* x (log y)))))
             (if (<= x -3e+186)
               t_1
               (if (<= x 7.4e+158) (fma y i (fma b (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 = fma(y, i, (x * log(y)));
          	double tmp;
          	if (x <= -3e+186) {
          		tmp = t_1;
          	} else if (x <= 7.4e+158) {
          		tmp = fma(y, i, fma(b, log(c), (z + a)));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i)
          	t_1 = fma(y, i, Float64(x * log(y)))
          	tmp = 0.0
          	if (x <= -3e+186)
          		tmp = t_1;
          	elseif (x <= 7.4e+158)
          		tmp = fma(y, i, fma(b, log(c), Float64(z + a)));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+186], t$95$1, If[LessEqual[x, 7.4e+158], N[(y * i + N[(b * N[Log[c], $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
          \mathbf{if}\;x \leq -3 \cdot 10^{+186}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 7.4 \cdot 10^{+158}:\\
          \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, z + a\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -2.99999999999999982e186 or 7.40000000000000021e158 < x

            1. Initial program 99.3%

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

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

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

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

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

                \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
              5. lower-fma.f64N/A

                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
              6. lower-/.f64N/A

                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
              7. lift-log.f6466.4

                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
            4. Applied rewrites66.4%

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

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

                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                3. lift-*.f64N/A

                  \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                4. lower-fma.f6466.4

                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                5. lift-+.f64N/A

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

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

                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                8. lift-log.f64N/A

                  \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                9. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b, \log c, \left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)}\right) \]
              3. Applied rewrites66.4%

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

                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{x \cdot \log y}\right) \]
              5. Step-by-step derivation
                1. associate-+l+N/A

                  \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
                2. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
                3. associate-+l+N/A

                  \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
                4. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{x} \cdot \log y\right) \]
                5. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(y, i, x \cdot \color{blue}{\log y}\right) \]
                6. lift-log.f6469.4

                  \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
              6. Applied rewrites69.4%

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

              if -2.99999999999999982e186 < x < 7.40000000000000021e158

              1. Initial program 99.8%

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

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

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

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

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

                  \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                5. lower-fma.f64N/A

                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                6. lower-/.f64N/A

                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                7. lift-log.f6495.4

                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
              4. Applied rewrites95.4%

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

                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
              6. Step-by-step derivation
                1. Applied rewrites93.5%

                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

                    \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                  4. lower-fma.f6493.5

                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                  5. lift-+.f64N/A

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

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

                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                  8. lift-log.f64N/A

                    \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                  9. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b, \log c, \left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)}\right) \]
                3. Applied rewrites93.5%

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

                  \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{z} + a\right)\right) \]
                5. Step-by-step derivation
                  1. Applied rewrites76.7%

                    \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{z} + a\right)\right) \]
                6. Recombined 2 regimes into one program.
                7. Add Preprocessing

                Alternative 7: 61.4% accurate, 0.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\ \;\;\;\;\left(z + \log c \cdot b\right) + y \cdot i\\ \mathbf{elif}\;t\_1 \leq 200:\\ \;\;\;\;\left(z + -0.5 \cdot \log c\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, t + a\right)\right)\\ \end{array} \end{array} \]
                (FPCore (x y z t a b c i)
                 :precision binary64
                 (let* ((t_1
                         (+
                          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                          (* y i))))
                   (if (<= t_1 -5e+114)
                     (+ (+ z (* (log c) b)) (* y i))
                     (if (<= t_1 200.0)
                       (+ (+ z (* -0.5 (log c))) (* y i))
                       (fma y i (fma b (log c) (+ t a)))))))
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                	double tmp;
                	if (t_1 <= -5e+114) {
                		tmp = (z + (log(c) * b)) + (y * i);
                	} else if (t_1 <= 200.0) {
                		tmp = (z + (-0.5 * log(c))) + (y * i);
                	} else {
                		tmp = fma(y, i, fma(b, log(c), (t + a)));
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b, c, i)
                	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                	tmp = 0.0
                	if (t_1 <= -5e+114)
                		tmp = Float64(Float64(z + Float64(log(c) * b)) + Float64(y * i));
                	elseif (t_1 <= 200.0)
                		tmp = Float64(Float64(z + Float64(-0.5 * log(c))) + Float64(y * i));
                	else
                		tmp = fma(y, i, fma(b, log(c), Float64(t + a)));
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -5e+114], N[(N[(z + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 200.0], N[(N[(z + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(b * N[Log[c], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \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\\
                \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
                \;\;\;\;\left(z + \log c \cdot b\right) + y \cdot i\\
                
                \mathbf{elif}\;t\_1 \leq 200:\\
                \;\;\;\;\left(z + -0.5 \cdot \log c\right) + y \cdot i\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, t + a\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -5.0000000000000001e114

                  1. Initial program 99.9%

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

                    \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                  3. Step-by-step derivation
                    1. Applied rewrites54.5%

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

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

                        \[\leadsto \left(z + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                      2. lower-*.f64N/A

                        \[\leadsto \left(z + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                      3. lift-log.f6454.5

                        \[\leadsto \left(z + \log c \cdot b\right) + y \cdot i \]
                    4. Applied rewrites54.5%

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

                    if -5.0000000000000001e114 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                    1. Initial program 99.9%

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

                      \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                    3. Step-by-step derivation
                      1. Applied rewrites60.9%

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

                        \[\leadsto \left(z + \color{blue}{\frac{-1}{2}} \cdot \log c\right) + y \cdot i \]
                      3. Step-by-step derivation
                        1. Applied rewrites48.1%

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

                        if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                        1. Initial program 99.6%

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

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

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

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

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

                            \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                          5. lower-fma.f64N/A

                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                          6. lower-/.f64N/A

                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                          7. lift-log.f6488.3

                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        4. Applied rewrites88.3%

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

                          \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                        6. Step-by-step derivation
                          1. Applied rewrites87.5%

                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

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

                              \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                            4. lower-fma.f6487.5

                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                            5. lift-+.f64N/A

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

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

                              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                            8. lift-log.f64N/A

                              \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                            9. lower-fma.f64N/A

                              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b, \log c, \left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)}\right) \]
                          3. Applied rewrites87.5%

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

                            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{t} + a\right)\right) \]
                          5. Step-by-step derivation
                            1. Applied rewrites69.2%

                              \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, \color{blue}{t} + a\right)\right) \]
                          6. Recombined 3 regimes into one program.
                          7. Add Preprocessing

                          Alternative 8: 54.4% accurate, 0.4× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot b\\ t_2 := \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\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+114}:\\ \;\;\;\;\left(z + t\_1\right) + y \cdot i\\ \mathbf{elif}\;t\_2 \leq 200:\\ \;\;\;\;\left(z + -0.5 \cdot \log c\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\_1\right) + y \cdot i\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b c i)
                           :precision binary64
                           (let* ((t_1 (* (log c) b))
                                  (t_2
                                   (+
                                    (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                    (* y i))))
                             (if (<= t_2 -5e+114)
                               (+ (+ z t_1) (* y i))
                               (if (<= t_2 200.0)
                                 (+ (+ z (* -0.5 (log c))) (* y i))
                                 (+ (+ 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 = log(c) * b;
                          	double t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                          	double tmp;
                          	if (t_2 <= -5e+114) {
                          		tmp = (z + t_1) + (y * i);
                          	} else if (t_2 <= 200.0) {
                          		tmp = (z + (-0.5 * log(c))) + (y * i);
                          	} else {
                          		tmp = (a + t_1) + (y * i);
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y, z, t, a, b, c, i)
                          use fmin_fmax_functions
                              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 = log(c) * b
                              t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
                              if (t_2 <= (-5d+114)) then
                                  tmp = (z + t_1) + (y * i)
                              else if (t_2 <= 200.0d0) then
                                  tmp = (z + ((-0.5d0) * log(c))) + (y * i)
                              else
                                  tmp = (a + 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 = Math.log(c) * b;
                          	double t_2 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                          	double tmp;
                          	if (t_2 <= -5e+114) {
                          		tmp = (z + t_1) + (y * i);
                          	} else if (t_2 <= 200.0) {
                          		tmp = (z + (-0.5 * Math.log(c))) + (y * i);
                          	} else {
                          		tmp = (a + t_1) + (y * i);
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a, b, c, i):
                          	t_1 = math.log(c) * b
                          	t_2 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                          	tmp = 0
                          	if t_2 <= -5e+114:
                          		tmp = (z + t_1) + (y * i)
                          	elif t_2 <= 200.0:
                          		tmp = (z + (-0.5 * math.log(c))) + (y * i)
                          	else:
                          		tmp = (a + t_1) + (y * i)
                          	return tmp
                          
                          function code(x, y, z, t, a, b, c, i)
                          	t_1 = Float64(log(c) * b)
                          	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                          	tmp = 0.0
                          	if (t_2 <= -5e+114)
                          		tmp = Float64(Float64(z + t_1) + Float64(y * i));
                          	elseif (t_2 <= 200.0)
                          		tmp = Float64(Float64(z + Float64(-0.5 * log(c))) + Float64(y * i));
                          	else
                          		tmp = Float64(Float64(a + t_1) + Float64(y * i));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a, b, c, i)
                          	t_1 = log(c) * b;
                          	t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                          	tmp = 0.0;
                          	if (t_2 <= -5e+114)
                          		tmp = (z + t_1) + (y * i);
                          	elseif (t_2 <= 200.0)
                          		tmp = (z + (-0.5 * log(c))) + (y * i);
                          	else
                          		tmp = (a + t_1) + (y * i);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -5e+114], N[(N[(z + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 200.0], N[(N[(z + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(a + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := \log c \cdot b\\
                          t_2 := \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\\
                          \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+114}:\\
                          \;\;\;\;\left(z + t\_1\right) + y \cdot i\\
                          
                          \mathbf{elif}\;t\_2 \leq 200:\\
                          \;\;\;\;\left(z + -0.5 \cdot \log c\right) + y \cdot i\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(a + t\_1\right) + y \cdot i\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -5.0000000000000001e114

                            1. Initial program 99.9%

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

                              \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                            3. Step-by-step derivation
                              1. Applied rewrites54.5%

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

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

                                  \[\leadsto \left(z + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                2. lower-*.f64N/A

                                  \[\leadsto \left(z + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                3. lift-log.f6454.5

                                  \[\leadsto \left(z + \log c \cdot b\right) + y \cdot i \]
                              4. Applied rewrites54.5%

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

                              if -5.0000000000000001e114 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                              1. Initial program 99.9%

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

                                \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                              3. Step-by-step derivation
                                1. Applied rewrites60.9%

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

                                  \[\leadsto \left(z + \color{blue}{\frac{-1}{2}} \cdot \log c\right) + y \cdot i \]
                                3. Step-by-step derivation
                                  1. Applied rewrites48.1%

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

                                  if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                  1. Initial program 99.6%

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

                                    \[\leadsto \left(\color{blue}{a} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites55.7%

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

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

                                        \[\leadsto \left(a + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                      2. lift-log.f64N/A

                                        \[\leadsto \left(a + \log c \cdot b\right) + y \cdot i \]
                                      3. lift-*.f6455.0

                                        \[\leadsto \left(a + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                    4. Applied rewrites55.0%

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

                                  Alternative 9: 54.0% accurate, 0.6× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot b\\ \mathbf{if}\;\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 \leq -100:\\ \;\;\;\;\left(z + t\_1\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\_1\right) + y \cdot i\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a b c i)
                                   :precision binary64
                                   (let* ((t_1 (* (log c) b)))
                                     (if (<=
                                          (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
                                          -100.0)
                                       (+ (+ z t_1) (* y i))
                                       (+ (+ 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 = log(c) * b;
                                  	double tmp;
                                  	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -100.0) {
                                  		tmp = (z + t_1) + (y * i);
                                  	} else {
                                  		tmp = (a + t_1) + (y * i);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y, z, t, a, b, c, i)
                                  use fmin_fmax_functions
                                      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 = log(c) * b
                                      if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-100.0d0)) then
                                          tmp = (z + t_1) + (y * i)
                                      else
                                          tmp = (a + 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 = Math.log(c) * b;
                                  	double tmp;
                                  	if (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -100.0) {
                                  		tmp = (z + t_1) + (y * i);
                                  	} else {
                                  		tmp = (a + t_1) + (y * i);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t, a, b, c, i):
                                  	t_1 = math.log(c) * b
                                  	tmp = 0
                                  	if ((((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)) <= -100.0:
                                  		tmp = (z + t_1) + (y * i)
                                  	else:
                                  		tmp = (a + t_1) + (y * i)
                                  	return tmp
                                  
                                  function code(x, y, z, t, a, b, c, i)
                                  	t_1 = Float64(log(c) * b)
                                  	tmp = 0.0
                                  	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -100.0)
                                  		tmp = Float64(Float64(z + t_1) + Float64(y * i));
                                  	else
                                  		tmp = Float64(Float64(a + t_1) + Float64(y * i));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t, a, b, c, i)
                                  	t_1 = log(c) * b;
                                  	tmp = 0.0;
                                  	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -100.0)
                                  		tmp = (z + t_1) + (y * i);
                                  	else
                                  		tmp = (a + t_1) + (y * i);
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[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], -100.0], N[(N[(z + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(a + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := \log c \cdot b\\
                                  \mathbf{if}\;\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 \leq -100:\\
                                  \;\;\;\;\left(z + t\_1\right) + y \cdot i\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(a + t\_1\right) + y \cdot i\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100

                                    1. Initial program 99.9%

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

                                      \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites54.7%

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

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

                                          \[\leadsto \left(z + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                        2. lower-*.f64N/A

                                          \[\leadsto \left(z + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                        3. lift-log.f6453.6

                                          \[\leadsto \left(z + \log c \cdot b\right) + y \cdot i \]
                                      4. Applied rewrites53.6%

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

                                      if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                      1. Initial program 99.6%

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

                                        \[\leadsto \left(\color{blue}{a} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites56.1%

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

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

                                            \[\leadsto \left(a + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                          2. lift-log.f64N/A

                                            \[\leadsto \left(a + \log c \cdot b\right) + y \cdot i \]
                                          3. lift-*.f6454.4

                                            \[\leadsto \left(a + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                        4. Applied rewrites54.4%

                                          \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
                                      4. Recombined 2 regimes into one program.
                                      5. Add Preprocessing

                                      Alternative 10: 53.9% accurate, 0.4× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \log y + z\right) + t\\ t_2 := \left(\left(t\_1 + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+288}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{elif}\;t\_2 \leq -300:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(a + \log c \cdot b\right) + y \cdot i\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a b c i)
                                       :precision binary64
                                       (let* ((t_1 (+ (+ (* x (log y)) z) t))
                                              (t_2 (+ (+ (+ t_1 a) (* (- b 0.5) (log c))) (* y i))))
                                         (if (<= t_2 -4e+288)
                                           (fma y i z)
                                           (if (<= t_2 -300.0) t_1 (+ (+ a (* (log c) b)) (* 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)) + z) + t;
                                      	double t_2 = ((t_1 + a) + ((b - 0.5) * log(c))) + (y * i);
                                      	double tmp;
                                      	if (t_2 <= -4e+288) {
                                      		tmp = fma(y, i, z);
                                      	} else if (t_2 <= -300.0) {
                                      		tmp = t_1;
                                      	} else {
                                      		tmp = (a + (log(c) * b)) + (y * i);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, y, z, t, a, b, c, i)
                                      	t_1 = Float64(Float64(Float64(x * log(y)) + z) + t)
                                      	t_2 = Float64(Float64(Float64(t_1 + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                      	tmp = 0.0
                                      	if (t_2 <= -4e+288)
                                      		tmp = fma(y, i, z);
                                      	elseif (t_2 <= -300.0)
                                      		tmp = t_1;
                                      	else
                                      		tmp = Float64(Float64(a + Float64(log(c) * b)) + Float64(y * i));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+288], N[(y * i + z), $MachinePrecision], If[LessEqual[t$95$2, -300.0], t$95$1, N[(N[(a + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := \left(x \cdot \log y + z\right) + t\\
                                      t_2 := \left(\left(t\_1 + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                      \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+288}:\\
                                      \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                                      
                                      \mathbf{elif}\;t\_2 \leq -300:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(a + \log c \cdot b\right) + y \cdot i\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -4e288

                                        1. Initial program 99.9%

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

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

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

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

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

                                            \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                          5. lower-fma.f64N/A

                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                          6. lower-/.f64N/A

                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                          7. lift-log.f6489.7

                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                        4. Applied rewrites89.7%

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

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

                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                          2. Step-by-step derivation
                                            1. lift-+.f64N/A

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

                                              \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                            3. lift-*.f64N/A

                                              \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                            4. lower-fma.f6489.7

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                            5. lift-+.f64N/A

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

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

                                              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                            8. lift-log.f64N/A

                                              \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                            9. lower-fma.f64N/A

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

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

                                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]
                                          5. Step-by-step derivation
                                            1. associate-+l+60.2

                                              \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                            2. *-commutative60.2

                                              \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                            3. associate-+l+60.2

                                              \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                            4. +-commutative60.2

                                              \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                          6. Applied rewrites60.2%

                                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]

                                          if -4e288 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -300

                                          1. Initial program 99.8%

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

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

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

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

                                              \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                            4. lower-+.f64N/A

                                              \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                            5. lower-fma.f64N/A

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

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

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

                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
                                            9. lift--.f64N/A

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

                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                            11. lower-*.f64N/A

                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                            12. lift-log.f6482.0

                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
                                          4. Applied rewrites82.0%

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

                                            \[\leadsto \left(x \cdot \log y + z\right) + t \]
                                          6. Step-by-step derivation
                                            1. lower-*.f64N/A

                                              \[\leadsto \left(x \cdot \log y + z\right) + t \]
                                            2. lift-log.f6451.5

                                              \[\leadsto \left(x \cdot \log y + z\right) + t \]
                                          7. Applied rewrites51.5%

                                            \[\leadsto \left(x \cdot \log y + z\right) + t \]

                                          if -300 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                          1. Initial program 99.6%

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

                                            \[\leadsto \left(\color{blue}{a} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites56.4%

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

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

                                                \[\leadsto \left(a + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                              2. lift-log.f64N/A

                                                \[\leadsto \left(a + \log c \cdot b\right) + y \cdot i \]
                                              3. lift-*.f6454.0

                                                \[\leadsto \left(a + \log c \cdot \color{blue}{b}\right) + y \cdot i \]
                                            4. Applied rewrites54.0%

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

                                          Alternative 11: 46.5% accurate, 0.4× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \log y + z\right) + t\\ t_2 := \left(\left(t\_1 + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+288}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{elif}\;t\_2 \leq -300:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z t a b c i)
                                           :precision binary64
                                           (let* ((t_1 (+ (+ (* x (log y)) z) t))
                                                  (t_2 (+ (+ (+ t_1 a) (* (- b 0.5) (log c))) (* y i))))
                                             (if (<= t_2 -4e+288) (fma y i z) (if (<= t_2 -300.0) t_1 (fma y i a)))))
                                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                          	double t_1 = ((x * log(y)) + z) + t;
                                          	double t_2 = ((t_1 + a) + ((b - 0.5) * log(c))) + (y * i);
                                          	double tmp;
                                          	if (t_2 <= -4e+288) {
                                          		tmp = fma(y, i, z);
                                          	} else if (t_2 <= -300.0) {
                                          		tmp = t_1;
                                          	} else {
                                          		tmp = fma(y, i, a);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z, t, a, b, c, i)
                                          	t_1 = Float64(Float64(Float64(x * log(y)) + z) + t)
                                          	t_2 = Float64(Float64(Float64(t_1 + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                          	tmp = 0.0
                                          	if (t_2 <= -4e+288)
                                          		tmp = fma(y, i, z);
                                          	elseif (t_2 <= -300.0)
                                          		tmp = t_1;
                                          	else
                                          		tmp = fma(y, i, a);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+288], N[(y * i + z), $MachinePrecision], If[LessEqual[t$95$2, -300.0], t$95$1, N[(y * i + a), $MachinePrecision]]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_1 := \left(x \cdot \log y + z\right) + t\\
                                          t_2 := \left(\left(t\_1 + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                          \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+288}:\\
                                          \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                                          
                                          \mathbf{elif}\;t\_2 \leq -300:\\
                                          \;\;\;\;t\_1\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -4e288

                                            1. Initial program 99.9%

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

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

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

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

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

                                                \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                              5. lower-fma.f64N/A

                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                              6. lower-/.f64N/A

                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                              7. lift-log.f6489.7

                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                            4. Applied rewrites89.7%

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

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

                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                              2. Step-by-step derivation
                                                1. lift-+.f64N/A

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

                                                  \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                3. lift-*.f64N/A

                                                  \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                                4. lower-fma.f6489.7

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                5. lift-+.f64N/A

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

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

                                                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                8. lift-log.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                9. lower-fma.f64N/A

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

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

                                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]
                                              5. Step-by-step derivation
                                                1. associate-+l+60.2

                                                  \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                2. *-commutative60.2

                                                  \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                3. associate-+l+60.2

                                                  \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                4. +-commutative60.2

                                                  \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                              6. Applied rewrites60.2%

                                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]

                                              if -4e288 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -300

                                              1. Initial program 99.8%

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

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

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

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

                                                  \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                4. lower-+.f64N/A

                                                  \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                5. lower-fma.f64N/A

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

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

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

                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
                                                9. lift--.f64N/A

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

                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                11. lower-*.f64N/A

                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                12. lift-log.f6482.0

                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
                                              4. Applied rewrites82.0%

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

                                                \[\leadsto \left(x \cdot \log y + z\right) + t \]
                                              6. Step-by-step derivation
                                                1. lower-*.f64N/A

                                                  \[\leadsto \left(x \cdot \log y + z\right) + t \]
                                                2. lift-log.f6451.5

                                                  \[\leadsto \left(x \cdot \log y + z\right) + t \]
                                              7. Applied rewrites51.5%

                                                \[\leadsto \left(x \cdot \log y + z\right) + t \]

                                              if -300 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                              1. Initial program 99.6%

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

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

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

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

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

                                                  \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                5. lower-fma.f64N/A

                                                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                6. lower-/.f64N/A

                                                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                7. lift-log.f6488.5

                                                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                              4. Applied rewrites88.5%

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

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

                                                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                2. Step-by-step derivation
                                                  1. lift-+.f64N/A

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

                                                    \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                  3. lift-*.f64N/A

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

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                  5. lift-+.f64N/A

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

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

                                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                  8. lift-log.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                  9. lower-fma.f64N/A

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

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

                                                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                5. Step-by-step derivation
                                                  1. associate-+l+39.3

                                                    \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                  2. *-commutative39.3

                                                    \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                  3. associate-+l+39.3

                                                    \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                  4. +-commutative39.3

                                                    \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                6. Applied rewrites39.3%

                                                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                              7. Recombined 3 regimes into one program.
                                              8. Add Preprocessing

                                              Alternative 12: 41.4% accurate, 0.8× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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 \leq -100:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
                                              (FPCore (x y z t a b c i)
                                               :precision binary64
                                               (if (<=
                                                    (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
                                                    -100.0)
                                                 (fma y i z)
                                                 (fma y i a)))
                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                              	double tmp;
                                              	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -100.0) {
                                              		tmp = fma(y, i, z);
                                              	} else {
                                              		tmp = fma(y, i, a);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(x, y, z, t, a, b, c, i)
                                              	tmp = 0.0
                                              	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -100.0)
                                              		tmp = fma(y, i, z);
                                              	else
                                              		tmp = fma(y, i, a);
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], -100.0], N[(y * i + z), $MachinePrecision], N[(y * i + a), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;\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 \leq -100:\\
                                              \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100

                                                1. Initial program 99.9%

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

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

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

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

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

                                                    \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                  5. lower-fma.f64N/A

                                                    \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                  7. lift-log.f6489.7

                                                    \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                4. Applied rewrites89.7%

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

                                                  \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites88.5%

                                                    \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                  2. Step-by-step derivation
                                                    1. lift-+.f64N/A

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

                                                      \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                    3. lift-*.f64N/A

                                                      \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                                    4. lower-fma.f6488.5

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                    5. lift-+.f64N/A

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

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

                                                      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                    8. lift-log.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                    9. lower-fma.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b, \log c, \left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)}\right) \]
                                                  3. Applied rewrites88.5%

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

                                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]
                                                  5. Step-by-step derivation
                                                    1. associate-+l+38.9

                                                      \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                    2. *-commutative38.9

                                                      \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                    3. associate-+l+38.9

                                                      \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                    4. +-commutative38.9

                                                      \[\leadsto \mathsf{fma}\left(y, i, z\right) \]
                                                  6. Applied rewrites38.9%

                                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]

                                                  if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                  1. Initial program 99.6%

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

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

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

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

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

                                                      \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                    5. lower-fma.f64N/A

                                                      \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                    6. lower-/.f64N/A

                                                      \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                    7. lift-log.f6488.4

                                                      \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                  4. Applied rewrites88.4%

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

                                                    \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites86.6%

                                                      \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                    2. Step-by-step derivation
                                                      1. lift-+.f64N/A

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

                                                        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                      3. lift-*.f64N/A

                                                        \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                                      4. lower-fma.f6486.6

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                      5. lift-+.f64N/A

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

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

                                                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                      8. lift-log.f64N/A

                                                        \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                      9. lower-fma.f64N/A

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

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

                                                      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                    5. Step-by-step derivation
                                                      1. associate-+l+39.7

                                                        \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                      2. *-commutative39.7

                                                        \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                      3. associate-+l+39.7

                                                        \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                      4. +-commutative39.7

                                                        \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                    6. Applied rewrites39.7%

                                                      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                  7. Recombined 2 regimes into one program.
                                                  8. Add Preprocessing

                                                  Alternative 13: 41.4% accurate, 0.4× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(y, i, t\right)\\ \mathbf{elif}\;t\_1 \leq -100:\\ \;\;\;\;z + t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
                                                  (FPCore (x y z t a b c i)
                                                   :precision binary64
                                                   (let* ((t_1
                                                           (+
                                                            (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                            (* y i))))
                                                     (if (<= t_1 (- INFINITY))
                                                       (fma y i t)
                                                       (if (<= t_1 -100.0) (+ z t) (fma y i a)))))
                                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                  	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                  	double tmp;
                                                  	if (t_1 <= -((double) INFINITY)) {
                                                  		tmp = fma(y, i, t);
                                                  	} else if (t_1 <= -100.0) {
                                                  		tmp = z + t;
                                                  	} else {
                                                  		tmp = fma(y, i, a);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(x, y, z, t, a, b, c, i)
                                                  	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                  	tmp = 0.0
                                                  	if (t_1 <= Float64(-Inf))
                                                  		tmp = fma(y, i, t);
                                                  	elseif (t_1 <= -100.0)
                                                  		tmp = Float64(z + t);
                                                  	else
                                                  		tmp = fma(y, i, a);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * i + t), $MachinePrecision], If[LessEqual[t$95$1, -100.0], N[(z + t), $MachinePrecision], N[(y * i + a), $MachinePrecision]]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  t_1 := \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\\
                                                  \mathbf{if}\;t\_1 \leq -\infty:\\
                                                  \;\;\;\;\mathsf{fma}\left(y, i, t\right)\\
                                                  
                                                  \mathbf{elif}\;t\_1 \leq -100:\\
                                                  \;\;\;\;z + t\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0

                                                    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. Taylor expanded in z around inf

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

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

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

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

                                                        \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                      5. lower-fma.f64N/A

                                                        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                      6. lower-/.f64N/A

                                                        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                      7. lift-log.f6493.5

                                                        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                    4. Applied rewrites93.5%

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

                                                      \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites93.5%

                                                        \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                      2. Step-by-step derivation
                                                        1. lift-+.f64N/A

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

                                                          \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                        3. lift-*.f64N/A

                                                          \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                                        4. lower-fma.f6493.5

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                        5. lift-+.f64N/A

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

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

                                                          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                        8. lift-log.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                        9. lower-fma.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b, \log c, \left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)}\right) \]
                                                      3. Applied rewrites93.5%

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

                                                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{t}\right) \]
                                                      5. Step-by-step derivation
                                                        1. associate-+l+95.8

                                                          \[\leadsto \mathsf{fma}\left(y, i, t\right) \]
                                                        2. *-commutative95.8

                                                          \[\leadsto \mathsf{fma}\left(y, i, t\right) \]
                                                        3. associate-+l+95.8

                                                          \[\leadsto \mathsf{fma}\left(y, i, t\right) \]
                                                        4. +-commutative95.8

                                                          \[\leadsto \mathsf{fma}\left(y, i, t\right) \]
                                                      6. Applied rewrites95.8%

                                                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{t}\right) \]

                                                      if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100

                                                      1. Initial program 99.8%

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

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

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

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

                                                          \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                        4. lower-+.f64N/A

                                                          \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                        5. lower-fma.f64N/A

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

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

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

                                                          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
                                                        9. lift--.f64N/A

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

                                                          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                        11. lower-*.f64N/A

                                                          \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                        12. lift-log.f6481.9

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

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

                                                        \[\leadsto z + t \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites35.7%

                                                          \[\leadsto z + t \]

                                                        if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                        1. Initial program 99.6%

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

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

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

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

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

                                                            \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                          5. lower-fma.f64N/A

                                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                          6. lower-/.f64N/A

                                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                          7. lift-log.f6488.4

                                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                        4. Applied rewrites88.4%

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

                                                          \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites86.6%

                                                            \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                          2. Step-by-step derivation
                                                            1. lift-+.f64N/A

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

                                                              \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                            3. lift-*.f64N/A

                                                              \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                                            4. lower-fma.f6486.6

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                            5. lift-+.f64N/A

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

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

                                                              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                            8. lift-log.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                            9. lower-fma.f64N/A

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

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

                                                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                          5. Step-by-step derivation
                                                            1. associate-+l+39.7

                                                              \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                            2. *-commutative39.7

                                                              \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                            3. associate-+l+39.7

                                                              \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                            4. +-commutative39.7

                                                              \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                          6. Applied rewrites39.7%

                                                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                        7. Recombined 3 regimes into one program.
                                                        8. Add Preprocessing

                                                        Alternative 14: 39.3% accurate, 0.4× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -100:\\ \;\;\;\;z + t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
                                                        (FPCore (x y z t a b c i)
                                                         :precision binary64
                                                         (let* ((t_1
                                                                 (+
                                                                  (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                                  (* y i))))
                                                           (if (<= t_1 (- INFINITY))
                                                             (* i y)
                                                             (if (<= t_1 -100.0) (+ z t) (fma y i a)))))
                                                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                        	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                        	double tmp;
                                                        	if (t_1 <= -((double) INFINITY)) {
                                                        		tmp = i * y;
                                                        	} else if (t_1 <= -100.0) {
                                                        		tmp = z + t;
                                                        	} else {
                                                        		tmp = fma(y, i, a);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(x, y, z, t, a, b, c, i)
                                                        	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                        	tmp = 0.0
                                                        	if (t_1 <= Float64(-Inf))
                                                        		tmp = Float64(i * y);
                                                        	elseif (t_1 <= -100.0)
                                                        		tmp = Float64(z + t);
                                                        	else
                                                        		tmp = fma(y, i, a);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -100.0], N[(z + t), $MachinePrecision], N[(y * i + a), $MachinePrecision]]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_1 := \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\\
                                                        \mathbf{if}\;t\_1 \leq -\infty:\\
                                                        \;\;\;\;i \cdot y\\
                                                        
                                                        \mathbf{elif}\;t\_1 \leq -100:\\
                                                        \;\;\;\;z + t\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0

                                                          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. Taylor expanded in y around inf

                                                            \[\leadsto \color{blue}{i \cdot y} \]
                                                          3. Step-by-step derivation
                                                            1. lower-*.f6495.8

                                                              \[\leadsto i \cdot \color{blue}{y} \]
                                                          4. Applied rewrites95.8%

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

                                                          if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100

                                                          1. Initial program 99.8%

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

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

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

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

                                                              \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                            4. lower-+.f64N/A

                                                              \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                            5. lower-fma.f64N/A

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

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

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

                                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
                                                            9. lift--.f64N/A

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

                                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                            11. lower-*.f64N/A

                                                              \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                            12. lift-log.f6481.9

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

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

                                                            \[\leadsto z + t \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites35.7%

                                                              \[\leadsto z + t \]

                                                            if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                            1. Initial program 99.6%

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

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

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

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

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

                                                                \[\leadsto \left(\left(\left(\left(x \cdot \frac{\log y}{z} + 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                              5. lower-fma.f64N/A

                                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                              6. lower-/.f64N/A

                                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                              7. lift-log.f6488.4

                                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                            4. Applied rewrites88.4%

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

                                                              \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites86.6%

                                                                \[\leadsto \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + \color{blue}{b} \cdot \log c\right) + y \cdot i \]
                                                              2. Step-by-step derivation
                                                                1. lift-+.f64N/A

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

                                                                  \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                                3. lift-*.f64N/A

                                                                  \[\leadsto \color{blue}{y \cdot i} + \left(\left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right) \]
                                                                4. lower-fma.f6486.6

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right) + b \cdot \log c\right)} \]
                                                                5. lift-+.f64N/A

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

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

                                                                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                                8. lift-log.f64N/A

                                                                  \[\leadsto \mathsf{fma}\left(y, i, b \cdot \color{blue}{\log c} + \left(\left(\mathsf{fma}\left(x, \frac{\log y}{z}, 1\right) \cdot z + t\right) + a\right)\right) \]
                                                                9. lower-fma.f64N/A

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

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

                                                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                              5. Step-by-step derivation
                                                                1. associate-+l+39.7

                                                                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                                2. *-commutative39.7

                                                                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                                3. associate-+l+39.7

                                                                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                                4. +-commutative39.7

                                                                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                                                              6. Applied rewrites39.7%

                                                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                            7. Recombined 3 regimes into one program.
                                                            8. Add Preprocessing

                                                            Alternative 15: 36.1% accurate, 0.3× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -50:\\ \;\;\;\;z + t\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                            (FPCore (x y z t a b c i)
                                                             :precision binary64
                                                             (let* ((t_1
                                                                     (+
                                                                      (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                                      (* y i))))
                                                               (if (<= t_1 (- INFINITY))
                                                                 (* i y)
                                                                 (if (<= t_1 -50.0) (+ z t) (if (<= t_1 5e+306) a (* i y))))))
                                                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                            	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                            	double tmp;
                                                            	if (t_1 <= -((double) INFINITY)) {
                                                            		tmp = i * y;
                                                            	} else if (t_1 <= -50.0) {
                                                            		tmp = z + t;
                                                            	} else if (t_1 <= 5e+306) {
                                                            		tmp = a;
                                                            	} else {
                                                            		tmp = i * y;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            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)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                                                            	double tmp;
                                                            	if (t_1 <= -Double.POSITIVE_INFINITY) {
                                                            		tmp = i * y;
                                                            	} else if (t_1 <= -50.0) {
                                                            		tmp = z + t;
                                                            	} else if (t_1 <= 5e+306) {
                                                            		tmp = a;
                                                            	} else {
                                                            		tmp = i * y;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(x, y, z, t, a, b, c, i):
                                                            	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                                                            	tmp = 0
                                                            	if t_1 <= -math.inf:
                                                            		tmp = i * y
                                                            	elif t_1 <= -50.0:
                                                            		tmp = z + t
                                                            	elif t_1 <= 5e+306:
                                                            		tmp = a
                                                            	else:
                                                            		tmp = i * y
                                                            	return tmp
                                                            
                                                            function code(x, y, z, t, a, b, c, i)
                                                            	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                            	tmp = 0.0
                                                            	if (t_1 <= Float64(-Inf))
                                                            		tmp = Float64(i * y);
                                                            	elseif (t_1 <= -50.0)
                                                            		tmp = Float64(z + t);
                                                            	elseif (t_1 <= 5e+306)
                                                            		tmp = a;
                                                            	else
                                                            		tmp = Float64(i * y);
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                            	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                            	tmp = 0.0;
                                                            	if (t_1 <= -Inf)
                                                            		tmp = i * y;
                                                            	elseif (t_1 <= -50.0)
                                                            		tmp = z + t;
                                                            	elseif (t_1 <= 5e+306)
                                                            		tmp = a;
                                                            	else
                                                            		tmp = i * y;
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -50.0], N[(z + t), $MachinePrecision], If[LessEqual[t$95$1, 5e+306], a, N[(i * y), $MachinePrecision]]]]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            t_1 := \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\\
                                                            \mathbf{if}\;t\_1 \leq -\infty:\\
                                                            \;\;\;\;i \cdot y\\
                                                            
                                                            \mathbf{elif}\;t\_1 \leq -50:\\
                                                            \;\;\;\;z + t\\
                                                            
                                                            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
                                                            \;\;\;\;a\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;i \cdot y\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 3 regimes
                                                            2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or 4.99999999999999993e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                              1. Initial program 99.1%

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

                                                                \[\leadsto \color{blue}{i \cdot y} \]
                                                              3. Step-by-step derivation
                                                                1. lower-*.f6491.4

                                                                  \[\leadsto i \cdot \color{blue}{y} \]
                                                              4. Applied rewrites91.4%

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

                                                              if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -50

                                                              1. Initial program 99.8%

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

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

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

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

                                                                  \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                                4. lower-+.f64N/A

                                                                  \[\leadsto \left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right) + t \]
                                                                5. lower-fma.f64N/A

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

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

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

                                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, x \cdot \log y\right)\right) + z\right) + t \]
                                                                9. lift--.f64N/A

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

                                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                                11. lower-*.f64N/A

                                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + z\right) + t \]
                                                                12. lift-log.f6481.9

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

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

                                                                \[\leadsto z + t \]
                                                              6. Step-by-step derivation
                                                                1. Applied rewrites35.6%

                                                                  \[\leadsto z + t \]

                                                                if -50 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 4.99999999999999993e306

                                                                1. Initial program 99.8%

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

                                                                  \[\leadsto \color{blue}{a} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites18.7%

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

                                                                Alternative 16: 16.8% accurate, 0.9× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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 \leq -50:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
                                                                (FPCore (x y z t a b c i)
                                                                 :precision binary64
                                                                 (if (<=
                                                                      (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
                                                                      -50.0)
                                                                   z
                                                                   a))
                                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                	double tmp;
                                                                	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -50.0) {
                                                                		tmp = z;
                                                                	} else {
                                                                		tmp = a;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                module fmin_fmax_functions
                                                                    implicit none
                                                                    private
                                                                    public fmax
                                                                    public fmin
                                                                
                                                                    interface fmax
                                                                        module procedure fmax88
                                                                        module procedure fmax44
                                                                        module procedure fmax84
                                                                        module procedure fmax48
                                                                    end interface
                                                                    interface fmin
                                                                        module procedure fmin88
                                                                        module procedure fmin44
                                                                        module procedure fmin84
                                                                        module procedure fmin48
                                                                    end interface
                                                                contains
                                                                    real(8) function fmax88(x, y) result (res)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(4) function fmax44(x, y) result (res)
                                                                        real(4), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmax84(x, y) result(res)
                                                                        real(8), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmax48(x, y) result(res)
                                                                        real(4), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin88(x, y) result (res)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(4) function fmin44(x, y) result (res)
                                                                        real(4), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin84(x, y) result(res)
                                                                        real(8), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin48(x, y) result(res)
                                                                        real(4), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                    end function
                                                                end module
                                                                
                                                                real(8) function code(x, y, z, t, a, b, c, i)
                                                                use fmin_fmax_functions
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    real(8), intent (in) :: z
                                                                    real(8), intent (in) :: t
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8), intent (in) :: c
                                                                    real(8), intent (in) :: i
                                                                    real(8) :: tmp
                                                                    if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-50.0d0)) 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 (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -50.0) {
                                                                		tmp = z;
                                                                	} else {
                                                                		tmp = a;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(x, y, z, t, a, b, c, i):
                                                                	tmp = 0
                                                                	if ((((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)) <= -50.0:
                                                                		tmp = z
                                                                	else:
                                                                		tmp = a
                                                                	return tmp
                                                                
                                                                function code(x, y, z, t, a, b, c, i)
                                                                	tmp = 0.0
                                                                	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -50.0)
                                                                		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 (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -50.0)
                                                                		tmp = z;
                                                                	else
                                                                		tmp = a;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], -50.0], z, a]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;\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 \leq -50:\\
                                                                \;\;\;\;z\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;a\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -50

                                                                  1. Initial program 99.9%

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

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

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

                                                                    if -50 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                                    1. Initial program 99.6%

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

                                                                      \[\leadsto \color{blue}{a} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites16.3%

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

                                                                    Alternative 17: 16.7% accurate, 37.6× 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;
                                                                    }
                                                                    
                                                                    module fmin_fmax_functions
                                                                        implicit none
                                                                        private
                                                                        public fmax
                                                                        public fmin
                                                                    
                                                                        interface fmax
                                                                            module procedure fmax88
                                                                            module procedure fmax44
                                                                            module procedure fmax84
                                                                            module procedure fmax48
                                                                        end interface
                                                                        interface fmin
                                                                            module procedure fmin88
                                                                            module procedure fmin44
                                                                            module procedure fmin84
                                                                            module procedure fmin48
                                                                        end interface
                                                                    contains
                                                                        real(8) function fmax88(x, y) result (res)
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(4) function fmax44(x, y) result (res)
                                                                            real(4), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmax84(x, y) result(res)
                                                                            real(8), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmax48(x, y) result(res)
                                                                            real(4), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmin88(x, y) result (res)
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(4) function fmin44(x, y) result (res)
                                                                            real(4), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmin84(x, y) result(res)
                                                                            real(8), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmin48(x, y) result(res)
                                                                            real(4), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                        end function
                                                                    end module
                                                                    
                                                                    real(8) function code(x, y, z, t, a, b, c, i)
                                                                    use fmin_fmax_functions
                                                                        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.7%

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

                                                                      \[\leadsto \color{blue}{a} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites16.7%

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

                                                                      Reproduce

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