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

Percentage Accurate: 99.8% → 99.8%
Time: 7.5s
Alternatives: 16
Speedup: 0.9×

Specification

?
\[\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 \]
(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]
\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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\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 \]
(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]
\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

Alternative 1: 99.8% accurate, 0.9× speedup?

\[\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, \mathsf{min}\left(z, a\right)\right)\right) + \mathsf{max}\left(z, a\right)\right) + t\right) \]
(FPCore (x y z t a b c i)
 :precision binary64
 (fma
  y
  i
  (+ (+ (fma (log c) (- b 0.5) (fma (log y) x (fmin z a))) (fmax z a)) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(y, i, ((fma(log(c), (b - 0.5), fma(log(y), x, fmin(z, a))) + fmax(z, a)) + t));
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), fma(log(y), x, fmin(z, a))) + fmax(z, a)) + t))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[Min[z, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Max[z, a], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, \mathsf{min}\left(z, a\right)\right)\right) + \mathsf{max}\left(z, a\right)\right) + t\right)
Derivation
  1. Initial program 99.8%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 0.7× speedup?

\[\mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right) + \left(\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right) + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\right) \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+
  (fmax (fmax z t) (fmax (fmin z t) a))
  (+ (fmin (fmin z t) a) (fma i y (fma x (log y) (* (log c) (- b 0.5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fmax(fmax(z, t), fmax(fmin(z, t), a)) + (fmin(fmin(z, t), a) + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5)))));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(fmax(fmax(z, t), fmax(fmin(z, t), a)) + Float64(fmin(fmin(z, t), a) + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5))))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision] + N[(N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision] + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right) + \left(\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right) + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)
Derivation
  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 t around 0

    \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

      \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
    8. lower--.f6485.3%

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

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

Alternative 3: 93.9% accurate, 0.6× speedup?

\[\begin{array}{l} t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\ t_4 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_5 := x \cdot \log y\\ \mathbf{if}\;x \leq -2.15 \cdot 10^{+125}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, t\_2 + \left(t\_3 + \left(t\_4 + t\_5\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+203}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, t\_4\right) + t\_2\right) + t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 + \left(t\_4 + \mathsf{fma}\left(i, y, 1 \cdot t\_5\right)\right)\\ \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (fmax (fmin z t) a))
        (t_2 (fmax (fmax z t) t_1))
        (t_3 (fmin (fmax z t) t_1))
        (t_4 (fmin (fmin z t) a))
        (t_5 (* x (log y))))
   (if (<= x -2.15e+125)
     (fma (- b 0.5) (log c) (+ t_2 (+ t_3 (+ t_4 t_5))))
     (if (<= x 1.15e+203)
       (fma y i (+ (+ (fma (log c) (- b 0.5) t_4) t_2) t_3))
       (+ t_2 (+ t_4 (fma i y (* 1.0 t_5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = fmax(fmin(z, t), a);
	double t_2 = fmax(fmax(z, t), t_1);
	double t_3 = fmin(fmax(z, t), t_1);
	double t_4 = fmin(fmin(z, t), a);
	double t_5 = x * log(y);
	double tmp;
	if (x <= -2.15e+125) {
		tmp = fma((b - 0.5), log(c), (t_2 + (t_3 + (t_4 + t_5))));
	} else if (x <= 1.15e+203) {
		tmp = fma(y, i, ((fma(log(c), (b - 0.5), t_4) + t_2) + t_3));
	} else {
		tmp = t_2 + (t_4 + fma(i, y, (1.0 * t_5)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = fmax(fmin(z, t), a)
	t_2 = fmax(fmax(z, t), t_1)
	t_3 = fmin(fmax(z, t), t_1)
	t_4 = fmin(fmin(z, t), a)
	t_5 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -2.15e+125)
		tmp = fma(Float64(b - 0.5), log(c), Float64(t_2 + Float64(t_3 + Float64(t_4 + t_5))));
	elseif (x <= 1.15e+203)
		tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), t_4) + t_2) + t_3));
	else
		tmp = Float64(t_2 + Float64(t_4 + fma(i, y, Float64(1.0 * t_5))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$4 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$5 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.15e+125], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t$95$2 + N[(t$95$3 + N[(t$95$4 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+203], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$4 + N[(i * y + N[(1.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\
t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\
t_4 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_5 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+125}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, t\_2 + \left(t\_3 + \left(t\_4 + t\_5\right)\right)\right)\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{+203}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, t\_4\right) + t\_2\right) + t\_3\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_4 + \mathsf{fma}\left(i, y, 1 \cdot t\_5\right)\right)\\


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

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.15000000000000018e125 < x < 1.15e203

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.15e203 < x

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
        8. lower--.f6485.3%

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

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

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

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, x \cdot \log y - \left(\mathsf{neg}\left(\log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
        3. sub-to-multN/A

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

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

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

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

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\mathsf{neg}\left(\log c \cdot \left(b - \frac{1}{2}\right)\right)}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

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

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\log c \cdot \left(\mathsf{neg}\left(\left(b - \frac{1}{2}\right)\right)\right)}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
        10. sub-negate-revN/A

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

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

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

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

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\left(\frac{1}{2} - b\right) \cdot \log c}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
        15. lower-*.f6476.0%

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

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

        \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right) \]
      8. Step-by-step derivation
        1. Applied rewrites68.4%

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right) \]
      9. Recombined 3 regimes into one program.
      10. Add Preprocessing

      Alternative 4: 93.4% accurate, 0.6× speedup?

      \[\begin{array}{l} t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\ t_4 := t\_3 + \left(t\_2 + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right)\\ \mathbf{if}\;x \leq -9.2 \cdot 10^{+58}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+203}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, t\_2\right) + t\_3\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (let* ((t_1 (fmax (fmin z t) a))
              (t_2 (fmin (fmin z t) a))
              (t_3 (fmax (fmax z t) t_1))
              (t_4 (+ t_3 (+ t_2 (fma i y (* 1.0 (* x (log y))))))))
         (if (<= x -9.2e+58)
           t_4
           (if (<= x 1.15e+203)
             (fma y i (+ (+ (fma (log c) (- b 0.5) t_2) t_3) (fmin (fmax z t) t_1)))
             t_4))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = fmax(fmin(z, t), a);
      	double t_2 = fmin(fmin(z, t), a);
      	double t_3 = fmax(fmax(z, t), t_1);
      	double t_4 = t_3 + (t_2 + fma(i, y, (1.0 * (x * log(y)))));
      	double tmp;
      	if (x <= -9.2e+58) {
      		tmp = t_4;
      	} else if (x <= 1.15e+203) {
      		tmp = fma(y, i, ((fma(log(c), (b - 0.5), t_2) + t_3) + fmin(fmax(z, t), t_1)));
      	} else {
      		tmp = t_4;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b, c, i)
      	t_1 = fmax(fmin(z, t), a)
      	t_2 = fmin(fmin(z, t), a)
      	t_3 = fmax(fmax(z, t), t_1)
      	t_4 = Float64(t_3 + Float64(t_2 + fma(i, y, Float64(1.0 * Float64(x * log(y))))))
      	tmp = 0.0
      	if (x <= -9.2e+58)
      		tmp = t_4;
      	elseif (x <= 1.15e+203)
      		tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), t_2) + t_3) + fmin(fmax(z, t), t_1)));
      	else
      		tmp = t_4;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(t$95$2 + N[(i * y + N[(1.0 * N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.2e+58], t$95$4, If[LessEqual[x, 1.15e+203], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision] + N[Min[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
      
      \begin{array}{l}
      t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
      t_2 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
      t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\
      t_4 := t\_3 + \left(t\_2 + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right)\\
      \mathbf{if}\;x \leq -9.2 \cdot 10^{+58}:\\
      \;\;\;\;t\_4\\
      
      \mathbf{elif}\;x \leq 1.15 \cdot 10^{+203}:\\
      \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, t\_2\right) + t\_3\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_4\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -9.2000000000000001e58 or 1.15e203 < x

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

            \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
          8. lower--.f6485.3%

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

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

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

            \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, x \cdot \log y - \left(\mathsf{neg}\left(\log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
          3. sub-to-multN/A

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

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

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

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

            \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\mathsf{neg}\left(\log c \cdot \left(b - \frac{1}{2}\right)\right)}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

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

            \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\log c \cdot \left(\mathsf{neg}\left(\left(b - \frac{1}{2}\right)\right)\right)}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
          10. sub-negate-revN/A

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

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

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

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

            \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\left(\frac{1}{2} - b\right) \cdot \log c}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
          15. lower-*.f6476.0%

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

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

          \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right) \]
        8. Step-by-step derivation
          1. Applied rewrites68.4%

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

          if -9.2000000000000001e58 < x < 1.15e203

          1. Initial program 99.8%

            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 92.8% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right)\\ t_3 := t\_2 + \left(t\_1 + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right)\\ \mathbf{if}\;x \leq -9.2 \cdot 10^{+58}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+203}:\\ \;\;\;\;t\_2 + \left(t\_1 + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \]
          (FPCore (x y z t a b c i)
           :precision binary64
           (let* ((t_1 (fmin (fmin z t) a))
                  (t_2 (fmax (fmax z t) (fmax (fmin z t) a)))
                  (t_3 (+ t_2 (+ t_1 (fma i y (* 1.0 (* x (log y))))))))
             (if (<= x -9.2e+58)
               t_3
               (if (<= x 1.15e+203)
                 (+ t_2 (+ t_1 (fma i y (* (log c) (- b 0.5)))))
                 t_3))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double t_1 = fmin(fmin(z, t), a);
          	double t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a));
          	double t_3 = t_2 + (t_1 + fma(i, y, (1.0 * (x * log(y)))));
          	double tmp;
          	if (x <= -9.2e+58) {
          		tmp = t_3;
          	} else if (x <= 1.15e+203) {
          		tmp = t_2 + (t_1 + fma(i, y, (log(c) * (b - 0.5))));
          	} else {
          		tmp = t_3;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i)
          	t_1 = fmin(fmin(z, t), a)
          	t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a))
          	t_3 = Float64(t_2 + Float64(t_1 + fma(i, y, Float64(1.0 * Float64(x * log(y))))))
          	tmp = 0.0
          	if (x <= -9.2e+58)
          		tmp = t_3;
          	elseif (x <= 1.15e+203)
          		tmp = Float64(t_2 + Float64(t_1 + fma(i, y, Float64(log(c) * Float64(b - 0.5)))));
          	else
          		tmp = t_3;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(t$95$1 + N[(i * y + N[(1.0 * N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.2e+58], t$95$3, If[LessEqual[x, 1.15e+203], N[(t$95$2 + N[(t$95$1 + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
          
          \begin{array}{l}
          t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
          t_2 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right)\\
          t_3 := t\_2 + \left(t\_1 + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right)\\
          \mathbf{if}\;x \leq -9.2 \cdot 10^{+58}:\\
          \;\;\;\;t\_3\\
          
          \mathbf{elif}\;x \leq 1.15 \cdot 10^{+203}:\\
          \;\;\;\;t\_2 + \left(t\_1 + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_3\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -9.2000000000000001e58 or 1.15e203 < x

            1. Initial program 99.8%

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

              \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

                \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
              8. lower--.f6485.3%

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

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

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

                \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, x \cdot \log y - \left(\mathsf{neg}\left(\log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)\right) \]
              3. sub-to-multN/A

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

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

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

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

                \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\mathsf{neg}\left(\log c \cdot \left(b - \frac{1}{2}\right)\right)}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
              8. distribute-rgt-neg-inN/A

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

                \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\log c \cdot \left(\mathsf{neg}\left(\left(b - \frac{1}{2}\right)\right)\right)}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
              10. sub-negate-revN/A

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

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

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

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

                \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \left(1 - \frac{\left(\frac{1}{2} - b\right) \cdot \log c}{x \cdot \log y}\right) \cdot \left(x \cdot \log y\right)\right)\right) \]
              15. lower-*.f6476.0%

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

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

              \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, 1 \cdot \left(x \cdot \log y\right)\right)\right) \]
            8. Step-by-step derivation
              1. Applied rewrites68.4%

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

              if -9.2000000000000001e58 < x < 1.15e203

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

                \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

                  \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
                8. lower--.f6485.3%

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

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

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

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

                  \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                3. lower--.f6469.3%

                  \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right) \]
              7. Applied rewrites69.3%

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

            Alternative 6: 92.5% accurate, 0.6× speedup?

            \[\begin{array}{l} t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ \mathbf{if}\;t\_1 \leq -4.1 \cdot 10^{+88}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, t\_1\right) + t\_3\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3 + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\\ \end{array} \]
            (FPCore (x y z t a b c i)
             :precision binary64
             (let* ((t_1 (fmin (fmin z t) a))
                    (t_2 (fmax (fmin z t) a))
                    (t_3 (fmax (fmax z t) t_2)))
               (if (<= t_1 -4.1e+88)
                 (fma y i (+ (+ (fma (log c) (- b 0.5) t_1) t_3) (fmin (fmax z t) t_2)))
                 (+ t_3 (fma i y (fma x (log y) (* (log c) (- b 0.5))))))))
            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
            	double t_1 = fmin(fmin(z, t), a);
            	double t_2 = fmax(fmin(z, t), a);
            	double t_3 = fmax(fmax(z, t), t_2);
            	double tmp;
            	if (t_1 <= -4.1e+88) {
            		tmp = fma(y, i, ((fma(log(c), (b - 0.5), t_1) + t_3) + fmin(fmax(z, t), t_2)));
            	} else {
            		tmp = t_3 + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5))));
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b, c, i)
            	t_1 = fmin(fmin(z, t), a)
            	t_2 = fmax(fmin(z, t), a)
            	t_3 = fmax(fmax(z, t), t_2)
            	tmp = 0.0
            	if (t_1 <= -4.1e+88)
            		tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), t_1) + t_3) + fmin(fmax(z, t), t_2)));
            	else
            		tmp = Float64(t_3 + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5)))));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[t$95$1, -4.1e+88], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
            
            \begin{array}{l}
            t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
            t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
            t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
            \mathbf{if}\;t\_1 \leq -4.1 \cdot 10^{+88}:\\
            \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, t\_1\right) + t\_3\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_3 + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -4.10000000000000028e88

              1. Initial program 99.8%

                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -4.10000000000000028e88 < z

                1. Initial program 99.8%

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

                  \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

                    \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
                  8. lower--.f6485.3%

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

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

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

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

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

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

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

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

                    \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  7. lower--.f6470.6%

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

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

              Alternative 7: 86.8% accurate, 0.7× speedup?

              \[\begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+254}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+258}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right) + \left(\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right) + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_3 \cdot t\_1}{t\_3}\right)\\ \end{array} \]
              (FPCore (x y z t a b c i)
               :precision binary64
               (let* ((t_1 (* x (log y)))
                      (t_2 (fmax (fmin z t) a))
                      (t_3 (fmin (fmax z t) t_2)))
                 (if (<= x -3.2e+254)
                   t_1
                   (if (<= x 2.4e+258)
                     (+
                      (fmax (fmax z t) t_2)
                      (+ (fmin (fmin z t) a) (fma i y (* (log c) (- b 0.5)))))
                     (fma y i (/ (* t_3 t_1) t_3))))))
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = x * log(y);
              	double t_2 = fmax(fmin(z, t), a);
              	double t_3 = fmin(fmax(z, t), t_2);
              	double tmp;
              	if (x <= -3.2e+254) {
              		tmp = t_1;
              	} else if (x <= 2.4e+258) {
              		tmp = fmax(fmax(z, t), t_2) + (fmin(fmin(z, t), a) + fma(i, y, (log(c) * (b - 0.5))));
              	} else {
              		tmp = fma(y, i, ((t_3 * t_1) / t_3));
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b, c, i)
              	t_1 = Float64(x * log(y))
              	t_2 = fmax(fmin(z, t), a)
              	t_3 = fmin(fmax(z, t), t_2)
              	tmp = 0.0
              	if (x <= -3.2e+254)
              		tmp = t_1;
              	elseif (x <= 2.4e+258)
              		tmp = Float64(fmax(fmax(z, t), t_2) + Float64(fmin(fmin(z, t), a) + fma(i, y, Float64(log(c) * Float64(b - 0.5)))));
              	else
              		tmp = fma(y, i, Float64(Float64(t_3 * t_1) / t_3));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[x, -3.2e+254], t$95$1, If[LessEqual[x, 2.4e+258], N[(N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision] + N[(N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision] + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(t$95$3 * t$95$1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              t_1 := x \cdot \log y\\
              t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
              t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
              \mathbf{if}\;x \leq -3.2 \cdot 10^{+254}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;x \leq 2.4 \cdot 10^{+258}:\\
              \;\;\;\;\mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right) + \left(\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right) + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_3 \cdot t\_1}{t\_3}\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if x < -3.1999999999999998e254

                1. Initial program 99.8%

                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{x \cdot \log y} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto x \cdot \color{blue}{\log y} \]
                  2. lower-log.f6417.3%

                    \[\leadsto x \cdot \log y \]
                6. Applied rewrites17.3%

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

                if -3.1999999999999998e254 < x < 2.4e258

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

                  \[\leadsto \color{blue}{a + \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. lower-+.f64N/A

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

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

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

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

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

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

                    \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) \]
                  8. lower--.f6485.3%

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

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

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

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

                    \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                  3. lower--.f6469.3%

                    \[\leadsto a + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right) \]
                7. Applied rewrites69.3%

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

                if 2.4e258 < x

                1. Initial program 99.8%

                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, i, \frac{t \cdot \left(x \cdot \color{blue}{\log y}\right)}{t}\right) \]
                  3. lower-log.f6434.8%

                    \[\leadsto \mathsf{fma}\left(y, i, \frac{t \cdot \left(x \cdot \log y\right)}{t}\right) \]
                8. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{t \cdot \left(x \cdot \log y\right)}}{t}\right) \]
              3. Recombined 3 regimes into one program.
              4. Add Preprocessing

              Alternative 8: 73.8% accurate, 0.5× speedup?

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

                1. Initial program 99.8%

                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, i, \frac{b \cdot \left(t \cdot \color{blue}{\log c}\right)}{t}\right) \]
                  3. lower-log.f6434.2%

                    \[\leadsto \mathsf{fma}\left(y, i, \frac{b \cdot \left(t \cdot \log c\right)}{t}\right) \]
                8. Applied rewrites34.2%

                  \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{b \cdot \left(t \cdot \log c\right)}}{t}\right) \]

                if -1.0000000000000001e182 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 9.9999999999999991e211

                1. Initial program 99.8%

                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 9: 73.8% accurate, 0.5× speedup?

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

                    1. Initial program 99.8%

                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(y, i, \frac{b \cdot \left(t \cdot \color{blue}{\log c}\right)}{t}\right) \]
                      3. lower-log.f6434.2%

                        \[\leadsto \mathsf{fma}\left(y, i, \frac{b \cdot \left(t \cdot \log c\right)}{t}\right) \]
                    8. Applied rewrites34.2%

                      \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{b \cdot \left(t \cdot \log c\right)}}{t}\right) \]

                    if -1.0000000000000001e182 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 9.9999999999999991e211

                    1. Initial program 99.8%

                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 10: 54.3% accurate, 0.2× speedup?

                      \[\begin{array}{l} t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ t_5 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_5 \leq -5 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_1}{t\_3} \cdot t\_3\right)\\ \mathbf{elif}\;t\_5 \leq -100:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_3 \cdot t\_1}{t\_3}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4 \cdot t\_3}{t\_3}\right)\\ \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (let* ((t_1 (fmin (fmin z t) a))
                              (t_2 (fmax (fmin z t) a))
                              (t_3 (fmin (fmax z t) t_2))
                              (t_4 (fmax (fmax z t) t_2))
                              (t_5
                               (+
                                (+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
                                (* y i))))
                         (if (<= t_5 -5e+244)
                           (fma y i (* (/ t_1 t_3) t_3))
                           (if (<= t_5 -100.0)
                             (fma y i (/ (* t_3 t_1) t_3))
                             (fma y i (/ (* t_4 t_3) t_3))))))
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double t_1 = fmin(fmin(z, t), a);
                      	double t_2 = fmax(fmin(z, t), a);
                      	double t_3 = fmin(fmax(z, t), t_2);
                      	double t_4 = fmax(fmax(z, t), t_2);
                      	double t_5 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
                      	double tmp;
                      	if (t_5 <= -5e+244) {
                      		tmp = fma(y, i, ((t_1 / t_3) * t_3));
                      	} else if (t_5 <= -100.0) {
                      		tmp = fma(y, i, ((t_3 * t_1) / t_3));
                      	} else {
                      		tmp = fma(y, i, ((t_4 * t_3) / t_3));
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a, b, c, i)
                      	t_1 = fmin(fmin(z, t), a)
                      	t_2 = fmax(fmin(z, t), a)
                      	t_3 = fmin(fmax(z, t), t_2)
                      	t_4 = fmax(fmax(z, t), t_2)
                      	t_5 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + t_3) + t_4) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                      	tmp = 0.0
                      	if (t_5 <= -5e+244)
                      		tmp = fma(y, i, Float64(Float64(t_1 / t_3) * t_3));
                      	elseif (t_5 <= -100.0)
                      		tmp = fma(y, i, Float64(Float64(t_3 * t_1) / t_3));
                      	else
                      		tmp = fma(y, i, Float64(Float64(t_4 * t_3) / t_3));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -5e+244], N[(y * i + N[(N[(t$95$1 / t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -100.0], N[(y * i + N[(N[(t$95$3 * t$95$1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(t$95$4 * t$95$3), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]]
                      
                      \begin{array}{l}
                      t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
                      t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
                      t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
                      t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
                      t_5 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                      \mathbf{if}\;t\_5 \leq -5 \cdot 10^{+244}:\\
                      \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_1}{t\_3} \cdot t\_3\right)\\
                      
                      \mathbf{elif}\;t\_5 \leq -100:\\
                      \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_3 \cdot t\_1}{t\_3}\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4 \cdot t\_3}{t\_3}\right)\\
                      
                      
                      \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.00000000000000022e244

                        1. Initial program 99.8%

                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        2. Step-by-step derivation
                          1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                        5. Step-by-step derivation
                          1. Applied rewrites37.9%

                            \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                            4. lower-fma.f6437.9%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                          3. Applied rewrites37.9%

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

                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\frac{z}{t}} \cdot t\right) \]
                          5. Step-by-step derivation
                            1. lower-/.f6431.6%

                              \[\leadsto \mathsf{fma}\left(y, i, \frac{z}{\color{blue}{t}} \cdot t\right) \]
                          6. Applied rewrites31.6%

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

                          if -5.00000000000000022e244 < (+.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. Step-by-step derivation
                            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{t \cdot z}}{t}\right) \]
                          7. Step-by-step derivation
                            1. lower-*.f6434.2%

                              \[\leadsto \mathsf{fma}\left(y, i, \frac{t \cdot \color{blue}{z}}{t}\right) \]
                          8. Applied rewrites34.2%

                            \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{t \cdot z}}{t}\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.8%

                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{a \cdot t}}{t}\right) \]
                          7. Step-by-step derivation
                            1. lower-*.f6434.1%

                              \[\leadsto \mathsf{fma}\left(y, i, \frac{a \cdot \color{blue}{t}}{t}\right) \]
                          8. Applied rewrites34.1%

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

                        Alternative 11: 51.7% accurate, 0.3× speedup?

                        \[\begin{array}{l} t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -5 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_1}{t\_3} \cdot t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4 \cdot t\_3}{t\_3}\right)\\ \end{array} \]
                        (FPCore (x y z t a b c i)
                         :precision binary64
                         (let* ((t_1 (fmin (fmin z t) a))
                                (t_2 (fmax (fmin z t) a))
                                (t_3 (fmin (fmax z t) t_2))
                                (t_4 (fmax (fmax z t) t_2)))
                           (if (<=
                                (+
                                 (+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
                                 (* y i))
                                -5e+21)
                             (fma y i (* (/ t_1 t_3) t_3))
                             (fma y i (/ (* t_4 t_3) t_3)))))
                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	double t_1 = fmin(fmin(z, t), a);
                        	double t_2 = fmax(fmin(z, t), a);
                        	double t_3 = fmin(fmax(z, t), t_2);
                        	double t_4 = fmax(fmax(z, t), t_2);
                        	double tmp;
                        	if (((((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i)) <= -5e+21) {
                        		tmp = fma(y, i, ((t_1 / t_3) * t_3));
                        	} else {
                        		tmp = fma(y, i, ((t_4 * t_3) / t_3));
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z, t, a, b, c, i)
                        	t_1 = fmin(fmin(z, t), a)
                        	t_2 = fmax(fmin(z, t), a)
                        	t_3 = fmin(fmax(z, t), t_2)
                        	t_4 = fmax(fmax(z, t), t_2)
                        	tmp = 0.0
                        	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + t_3) + t_4) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -5e+21)
                        		tmp = fma(y, i, Float64(Float64(t_1 / t_3) * t_3));
                        	else
                        		tmp = fma(y, i, Float64(Float64(t_4 * t_3) / t_3));
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -5e+21], N[(y * i + N[(N[(t$95$1 / t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(t$95$4 * t$95$3), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
                        
                        \begin{array}{l}
                        t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
                        t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
                        t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
                        t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
                        \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -5 \cdot 10^{+21}:\\
                        \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_1}{t\_3} \cdot t\_3\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4 \cdot t\_3}{t\_3}\right)\\
                        
                        
                        \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)) < -5e21

                          1. Initial program 99.8%

                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                          5. Step-by-step derivation
                            1. Applied rewrites37.9%

                              \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                            2. Step-by-step derivation
                              1. lift-+.f64N/A

                                \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                              2. +-commutativeN/A

                                \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                              3. lift-*.f64N/A

                                \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                              4. lower-fma.f6437.9%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                            3. Applied rewrites37.9%

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

                              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\frac{z}{t}} \cdot t\right) \]
                            5. Step-by-step derivation
                              1. lower-/.f6431.6%

                                \[\leadsto \mathsf{fma}\left(y, i, \frac{z}{\color{blue}{t}} \cdot t\right) \]
                            6. Applied rewrites31.6%

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

                            if -5e21 < (+.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.8%

                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            2. Step-by-step derivation
                              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(y, i, \frac{\color{blue}{a \cdot t}}{t}\right) \]
                            7. Step-by-step derivation
                              1. lower-*.f6434.1%

                                \[\leadsto \mathsf{fma}\left(y, i, \frac{a \cdot \color{blue}{t}}{t}\right) \]
                            8. Applied rewrites34.1%

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

                          Alternative 12: 48.3% accurate, 0.3× speedup?

                          \[\begin{array}{l} t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\ \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -5 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_1}{t\_3} \cdot t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4}{t\_3} \cdot t\_3\right)\\ \end{array} \]
                          (FPCore (x y z t a b c i)
                           :precision binary64
                           (let* ((t_1 (fmin (fmin z t) a))
                                  (t_2 (fmax (fmin z t) a))
                                  (t_3 (fmin (fmax z t) t_2))
                                  (t_4 (fmax (fmax z t) t_2)))
                             (if (<=
                                  (+
                                   (+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
                                   (* y i))
                                  -5e+21)
                               (fma y i (* (/ t_1 t_3) t_3))
                               (fma y i (* (/ t_4 t_3) t_3)))))
                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                          	double t_1 = fmin(fmin(z, t), a);
                          	double t_2 = fmax(fmin(z, t), a);
                          	double t_3 = fmin(fmax(z, t), t_2);
                          	double t_4 = fmax(fmax(z, t), t_2);
                          	double tmp;
                          	if (((((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i)) <= -5e+21) {
                          		tmp = fma(y, i, ((t_1 / t_3) * t_3));
                          	} else {
                          		tmp = fma(y, i, ((t_4 / t_3) * t_3));
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t, a, b, c, i)
                          	t_1 = fmin(fmin(z, t), a)
                          	t_2 = fmax(fmin(z, t), a)
                          	t_3 = fmin(fmax(z, t), t_2)
                          	t_4 = fmax(fmax(z, t), t_2)
                          	tmp = 0.0
                          	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + t_3) + t_4) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -5e+21)
                          		tmp = fma(y, i, Float64(Float64(t_1 / t_3) * t_3));
                          	else
                          		tmp = fma(y, i, Float64(Float64(t_4 / t_3) * t_3));
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -5e+21], N[(y * i + N[(N[(t$95$1 / t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(t$95$4 / t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
                          
                          \begin{array}{l}
                          t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
                          t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
                          t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
                          t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
                          \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -5 \cdot 10^{+21}:\\
                          \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_1}{t\_3} \cdot t\_3\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4}{t\_3} \cdot t\_3\right)\\
                          
                          
                          \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)) < -5e21

                            1. Initial program 99.8%

                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            2. Step-by-step derivation
                              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                            5. Step-by-step derivation
                              1. Applied rewrites37.9%

                                \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                              2. Step-by-step derivation
                                1. lift-+.f64N/A

                                  \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                                2. +-commutativeN/A

                                  \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                                4. lower-fma.f6437.9%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                              3. Applied rewrites37.9%

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

                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\frac{z}{t}} \cdot t\right) \]
                              5. Step-by-step derivation
                                1. lower-/.f6431.6%

                                  \[\leadsto \mathsf{fma}\left(y, i, \frac{z}{\color{blue}{t}} \cdot t\right) \]
                              6. Applied rewrites31.6%

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

                              if -5e21 < (+.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.8%

                                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                              2. Step-by-step derivation
                                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                              5. Step-by-step derivation
                                1. Applied rewrites37.9%

                                  \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                2. Step-by-step derivation
                                  1. lift-+.f64N/A

                                    \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                                  2. +-commutativeN/A

                                    \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                                  3. lift-*.f64N/A

                                    \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                                  4. lower-fma.f6437.9%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                                3. Applied rewrites37.9%

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

                                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\frac{a}{t}} \cdot t\right) \]
                                5. Step-by-step derivation
                                  1. lower-/.f6431.8%

                                    \[\leadsto \mathsf{fma}\left(y, i, \frac{a}{\color{blue}{t}} \cdot t\right) \]
                                6. Applied rewrites31.8%

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

                              Alternative 13: 40.2% accurate, 0.7× speedup?

                              \[\begin{array}{l} t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\ t_2 := x \cdot \log y\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\ \mathbf{if}\;x \leq -2.15 \cdot 10^{+125}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+211}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{\mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)}{t\_3} \cdot t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (let* ((t_1 (fmax (fmin z t) a))
                                      (t_2 (* x (log y)))
                                      (t_3 (fmin (fmax z t) t_1)))
                                 (if (<= x -2.15e+125)
                                   t_2
                                   (if (<= x 2e+211) (fma y i (* (/ (fmax (fmax z t) t_1) t_3) t_3)) t_2))))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	double t_1 = fmax(fmin(z, t), a);
                              	double t_2 = x * log(y);
                              	double t_3 = fmin(fmax(z, t), t_1);
                              	double tmp;
                              	if (x <= -2.15e+125) {
                              		tmp = t_2;
                              	} else if (x <= 2e+211) {
                              		tmp = fma(y, i, ((fmax(fmax(z, t), t_1) / t_3) * t_3));
                              	} else {
                              		tmp = t_2;
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	t_1 = fmax(fmin(z, t), a)
                              	t_2 = Float64(x * log(y))
                              	t_3 = fmin(fmax(z, t), t_1)
                              	tmp = 0.0
                              	if (x <= -2.15e+125)
                              		tmp = t_2;
                              	elseif (x <= 2e+211)
                              		tmp = fma(y, i, Float64(Float64(fmax(fmax(z, t), t_1) / t_3) * t_3));
                              	else
                              		tmp = t_2;
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[x, -2.15e+125], t$95$2, If[LessEqual[x, 2e+211], N[(y * i + N[(N[(N[Max[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision] / t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
                              
                              \begin{array}{l}
                              t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
                              t_2 := x \cdot \log y\\
                              t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\
                              \mathbf{if}\;x \leq -2.15 \cdot 10^{+125}:\\
                              \;\;\;\;t\_2\\
                              
                              \mathbf{elif}\;x \leq 2 \cdot 10^{+211}:\\
                              \;\;\;\;\mathsf{fma}\left(y, i, \frac{\mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)}{t\_3} \cdot t\_3\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_2\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if x < -2.15000000000000018e125 or 1.9999999999999999e211 < x

                                1. Initial program 99.8%

                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                2. Step-by-step derivation
                                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{x \cdot \log y} \]
                                5. Step-by-step derivation
                                  1. lower-*.f64N/A

                                    \[\leadsto x \cdot \color{blue}{\log y} \]
                                  2. lower-log.f6417.3%

                                    \[\leadsto x \cdot \log y \]
                                6. Applied rewrites17.3%

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

                                if -2.15000000000000018e125 < x < 1.9999999999999999e211

                                1. Initial program 99.8%

                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                2. Step-by-step derivation
                                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                5. Step-by-step derivation
                                  1. Applied rewrites37.9%

                                    \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                  2. Step-by-step derivation
                                    1. lift-+.f64N/A

                                      \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                                    4. lower-fma.f6437.9%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                                  3. Applied rewrites37.9%

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

                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\frac{a}{t}} \cdot t\right) \]
                                  5. Step-by-step derivation
                                    1. lower-/.f6431.8%

                                      \[\leadsto \mathsf{fma}\left(y, i, \frac{a}{\color{blue}{t}} \cdot t\right) \]
                                  6. Applied rewrites31.8%

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

                                Alternative 14: 38.2% accurate, 1.6× speedup?

                                \[\begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;y \leq 6.1 \cdot 10^{-153}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{-101}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, 1 \cdot \mathsf{min}\left(t, a\right)\right)\\ \end{array} \]
                                (FPCore (x y z t a b c i)
                                 :precision binary64
                                 (let* ((t_1 (* x (log y))))
                                   (if (<= y 6.1e-153)
                                     t_1
                                     (if (<= y 9.6e-101)
                                       (* b (log c))
                                       (if (<= y 8e+34) t_1 (fma y i (* 1.0 (fmin 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);
                                	double tmp;
                                	if (y <= 6.1e-153) {
                                		tmp = t_1;
                                	} else if (y <= 9.6e-101) {
                                		tmp = b * log(c);
                                	} else if (y <= 8e+34) {
                                		tmp = t_1;
                                	} else {
                                		tmp = fma(y, i, (1.0 * fmin(t, a)));
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, t, a, b, c, i)
                                	t_1 = Float64(x * log(y))
                                	tmp = 0.0
                                	if (y <= 6.1e-153)
                                		tmp = t_1;
                                	elseif (y <= 9.6e-101)
                                		tmp = Float64(b * log(c));
                                	elseif (y <= 8e+34)
                                		tmp = t_1;
                                	else
                                		tmp = fma(y, i, Float64(1.0 * fmin(t, 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[y, 6.1e-153], t$95$1, If[LessEqual[y, 9.6e-101], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+34], t$95$1, N[(y * i + N[(1.0 * N[Min[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                
                                \begin{array}{l}
                                t_1 := x \cdot \log y\\
                                \mathbf{if}\;y \leq 6.1 \cdot 10^{-153}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;y \leq 9.6 \cdot 10^{-101}:\\
                                \;\;\;\;b \cdot \log c\\
                                
                                \mathbf{elif}\;y \leq 8 \cdot 10^{+34}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\mathsf{fma}\left(y, i, 1 \cdot \mathsf{min}\left(t, a\right)\right)\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if y < 6.10000000000000046e-153 or 9.6e-101 < y < 7.99999999999999956e34

                                  1. Initial program 99.8%

                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                  2. Step-by-step derivation
                                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{x \cdot \log y} \]
                                  5. Step-by-step derivation
                                    1. lower-*.f64N/A

                                      \[\leadsto x \cdot \color{blue}{\log y} \]
                                    2. lower-log.f6417.3%

                                      \[\leadsto x \cdot \log y \]
                                  6. Applied rewrites17.3%

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

                                  if 6.10000000000000046e-153 < y < 9.6e-101

                                  1. Initial program 99.8%

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

                                    \[\leadsto \color{blue}{b \cdot \log c} \]
                                  3. Step-by-step derivation
                                    1. lower-*.f64N/A

                                      \[\leadsto b \cdot \color{blue}{\log c} \]
                                    2. lower-log.f6416.5%

                                      \[\leadsto b \cdot \log c \]
                                  4. Applied rewrites16.5%

                                    \[\leadsto \color{blue}{b \cdot \log c} \]

                                  if 7.99999999999999956e34 < y

                                  1. Initial program 99.8%

                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                  2. Step-by-step derivation
                                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                  5. Step-by-step derivation
                                    1. Applied rewrites37.9%

                                      \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                    2. Step-by-step derivation
                                      1. lift-+.f64N/A

                                        \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                                      2. +-commutativeN/A

                                        \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                                      3. lift-*.f64N/A

                                        \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                                      4. lower-fma.f6437.9%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                                    3. Applied rewrites37.9%

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

                                  Alternative 15: 36.0% accurate, 2.4× speedup?

                                  \[\begin{array}{l} \mathbf{if}\;y \leq 8 \cdot 10^{+34}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, 1 \cdot \mathsf{min}\left(t, a\right)\right)\\ \end{array} \]
                                  (FPCore (x y z t a b c i)
                                   :precision binary64
                                   (if (<= y 8e+34) (* x (log y)) (fma y i (* 1.0 (fmin t a)))))
                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                  	double tmp;
                                  	if (y <= 8e+34) {
                                  		tmp = x * log(y);
                                  	} else {
                                  		tmp = fma(y, i, (1.0 * fmin(t, a)));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(x, y, z, t, a, b, c, i)
                                  	tmp = 0.0
                                  	if (y <= 8e+34)
                                  		tmp = Float64(x * log(y));
                                  	else
                                  		tmp = fma(y, i, Float64(1.0 * fmin(t, a)));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 8e+34], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(y * i + N[(1.0 * N[Min[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  \mathbf{if}\;y \leq 8 \cdot 10^{+34}:\\
                                  \;\;\;\;x \cdot \log y\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\mathsf{fma}\left(y, i, 1 \cdot \mathsf{min}\left(t, a\right)\right)\\
                                  
                                  
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y < 7.99999999999999956e34

                                    1. Initial program 99.8%

                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                    2. Step-by-step derivation
                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{x \cdot \log y} \]
                                    5. Step-by-step derivation
                                      1. lower-*.f64N/A

                                        \[\leadsto x \cdot \color{blue}{\log y} \]
                                      2. lower-log.f6417.3%

                                        \[\leadsto x \cdot \log y \]
                                    6. Applied rewrites17.3%

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

                                    if 7.99999999999999956e34 < y

                                    1. Initial program 99.8%

                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                    2. Step-by-step derivation
                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                    5. Step-by-step derivation
                                      1. Applied rewrites37.9%

                                        \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                      2. Step-by-step derivation
                                        1. lift-+.f64N/A

                                          \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                                        2. +-commutativeN/A

                                          \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                                        4. lower-fma.f6437.9%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                                      3. Applied rewrites37.9%

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

                                    Alternative 16: 35.7% accurate, 3.1× speedup?

                                    \[\mathsf{fma}\left(y, i, 1 \cdot \mathsf{min}\left(t, a\right)\right) \]
                                    (FPCore (x y z t a b c i) :precision binary64 (fma y i (* 1.0 (fmin t a))))
                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                    	return fma(y, i, (1.0 * fmin(t, a)));
                                    }
                                    
                                    function code(x, y, z, t, a, b, c, i)
                                    	return fma(y, i, Float64(1.0 * fmin(t, a)))
                                    end
                                    
                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(1.0 * N[Min[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                    
                                    \mathsf{fma}\left(y, i, 1 \cdot \mathsf{min}\left(t, a\right)\right)
                                    
                                    Derivation
                                    1. Initial program 99.8%

                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                    2. Step-by-step derivation
                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                    5. Step-by-step derivation
                                      1. Applied rewrites37.9%

                                        \[\leadsto \color{blue}{1} \cdot t + y \cdot i \]
                                      2. Step-by-step derivation
                                        1. lift-+.f64N/A

                                          \[\leadsto \color{blue}{1 \cdot t + y \cdot i} \]
                                        2. +-commutativeN/A

                                          \[\leadsto \color{blue}{y \cdot i + 1 \cdot t} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \color{blue}{y \cdot i} + 1 \cdot t \]
                                        4. lower-fma.f6437.9%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                                      3. Applied rewrites37.9%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, 1 \cdot t\right)} \]
                                      4. Add Preprocessing

                                      Reproduce

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