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

Percentage Accurate: 99.8% → 99.8%
Time: 11.0s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(t + \mathsf{fma}\left(\log y, x, z\right)\right)\right)\right)
\end{array}
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. Add Preprocessing
  3. 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.9

      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 27.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+305}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -20:\\ \;\;\;\;z\\ \mathbf{elif}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1
         (+
          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
          (* y i))))
   (if (<= t_1 -1e+305)
     (* i y)
     (if (<= t_1 -20.0) z (if (<= t_1 1e+307) a (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_1 <= -1e+305) {
		tmp = i * y;
	} else if (t_1 <= -20.0) {
		tmp = z;
	} else if (t_1 <= 1e+307) {
		tmp = a;
	} else {
		tmp = i * y;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
    if (t_1 <= (-1d+305)) then
        tmp = i * y
    else if (t_1 <= (-20.0d0)) then
        tmp = z
    else if (t_1 <= 1d+307) then
        tmp = a
    else
        tmp = i * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_1 <= -1e+305) {
		tmp = i * y;
	} else if (t_1 <= -20.0) {
		tmp = z;
	} else if (t_1 <= 1e+307) {
		tmp = a;
	} else {
		tmp = i * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_1 <= -1e+305:
		tmp = i * y
	elif t_1 <= -20.0:
		tmp = z
	elif t_1 <= 1e+307:
		tmp = a
	else:
		tmp = i * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_1 <= -1e+305)
		tmp = Float64(i * y);
	elseif (t_1 <= -20.0)
		tmp = z;
	elseif (t_1 <= 1e+307)
		tmp = a;
	else
		tmp = Float64(i * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_1 <= -1e+305)
		tmp = i * y;
	elseif (t_1 <= -20.0)
		tmp = z;
	elseif (t_1 <= 1e+307)
		tmp = a;
	else
		tmp = i * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+305], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -20.0], z, If[LessEqual[t$95$1, 1e+307], a, N[(i * y), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -20:\\
\;\;\;\;z\\

\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -9.9999999999999994e304 or 9.99999999999999986e306 < (+.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 100.0%

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

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

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

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

    if -9.9999999999999994e304 < (+.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)) < -20

    1. Initial program 99.8%

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

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

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

      if -20 < (+.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)) < 9.99999999999999986e306

      1. Initial program 99.9%

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

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

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

      Alternative 3: 32.2% accurate, 0.5× speedup?

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

        1. Initial program 100.0%

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

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

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

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

        if -9.9999999999999994e304 < (+.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)) < 2e13

        1. Initial program 99.8%

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

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

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

          if 2e13 < (+.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.9%

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

              \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
          6. Step-by-step derivation
            1. Applied rewrites44.5%

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

          Alternative 4: 54.1% accurate, 0.7× speedup?

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

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

                \[\leadsto \left(\color{blue}{z} + \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(z + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i} \]
                2. +-commutativeN/A

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, z\right)}\right) \]
              3. Applied rewrites55.4%

                \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right)\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.9%

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

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

                  \[\leadsto \left(\color{blue}{z} + \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(z + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i} \]
                  2. +-commutativeN/A

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, z\right)}\right) \]
                3. Applied rewrites47.4%

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

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

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

                Alternative 5: 54.1% accurate, 0.7× speedup?

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

                  1. Initial program 99.8%

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

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

                      \[\leadsto \left(\color{blue}{z} + \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(z + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i} \]
                      2. +-commutativeN/A

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, z\right)}\right) \]
                    3. Applied rewrites55.3%

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

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

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

                      if -5.00000000000000021e35 < (+.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.9%

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

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

                          \[\leadsto \left(\color{blue}{z} + \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(z + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i} \]
                          2. +-commutativeN/A

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

                            \[\leadsto \color{blue}{y \cdot i} + \left(z + \left(b - \frac{1}{2}\right) \cdot \log c\right) \]
                          4. lower-fma.f6447.6

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

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

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

                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + z\right) \]
                          8. lower-fma.f6447.6

                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, z\right)}\right) \]
                        3. Applied rewrites47.6%

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

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

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

                        Alternative 6: 75.1% accurate, 0.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+190} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+179}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\ \end{array} \end{array} \]
                        (FPCore (x y z t a b c i)
                         :precision binary64
                         (let* ((t_1 (* (- b 0.5) (log c))))
                           (if (or (<= t_1 -2e+190) (not (<= t_1 5e+179)))
                             (fma y i (fma b (log c) z))
                             (fma (+ (fma i y t) a) (/ z z) z))))
                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	double t_1 = (b - 0.5) * log(c);
                        	double tmp;
                        	if ((t_1 <= -2e+190) || !(t_1 <= 5e+179)) {
                        		tmp = fma(y, i, fma(b, log(c), z));
                        	} else {
                        		tmp = fma((fma(i, y, t) + a), (z / z), z);
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z, t, a, b, c, i)
                        	t_1 = Float64(Float64(b - 0.5) * log(c))
                        	tmp = 0.0
                        	if ((t_1 <= -2e+190) || !(t_1 <= 5e+179))
                        		tmp = fma(y, i, fma(b, log(c), z));
                        	else
                        		tmp = fma(Float64(fma(i, y, t) + a), Float64(z / z), z);
                        	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]}, If[Or[LessEqual[t$95$1, -2e+190], N[Not[LessEqual[t$95$1, 5e+179]], $MachinePrecision]], N[(y * i + N[(b * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * y + t), $MachinePrecision] + a), $MachinePrecision] * N[(z / z), $MachinePrecision] + z), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \left(b - 0.5\right) \cdot \log c\\
                        \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+190} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+179}\right):\\
                        \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, z\right)\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -2.0000000000000001e190 or 5e179 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

                          1. Initial program 99.5%

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

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

                              \[\leadsto \left(\color{blue}{z} + \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(z + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i} \]
                              2. +-commutativeN/A

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + z\right) \]
                              8. lower-fma.f6484.2

                                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, z\right)}\right) \]
                            3. Applied rewrites84.2%

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

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

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

                              if -2.0000000000000001e190 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 5e179

                              1. Initial program 99.9%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, t\right) + a}{z}, z, z\right) \]
                              7. Step-by-step derivation
                                1. Applied rewrites60.0%

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

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

                                    \[\leadsto \frac{\mathsf{fma}\left(i, y, t\right) + a}{z} \cdot z + z \]
                                  3. associate-*l/N/A

                                    \[\leadsto \frac{\left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot z}{z} + z \]
                                  4. associate-/l*N/A

                                    \[\leadsto \left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot \frac{z}{z} + z \]
                                  5. lower-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                  6. lower-/.f6478.0

                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{\color{blue}{z}}, z\right) \]
                                3. Applied rewrites78.0%

                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification79.4%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(b - 0.5\right) \cdot \log c \leq -2 \cdot 10^{+190} \lor \neg \left(\left(b - 0.5\right) \cdot \log c \leq 5 \cdot 10^{+179}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b, \log c, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 7: 37.3% accurate, 1.0× speedup?

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

                                1. Initial program 99.8%

                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                2. Add Preprocessing
                                3. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{z}\right) \]
                                6. Step-by-step derivation
                                  1. Applied rewrites37.2%

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

                                  if -20 < (+.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.9%

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

                                      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites43.8%

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

                                  Alternative 8: 15.9% accurate, 1.0× speedup?

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

                                    1. Initial program 99.8%

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

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

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

                                      if -20 < (+.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.9%

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

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

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

                                      Alternative 9: 84.3% accurate, 1.0× speedup?

                                      \[\begin{array}{l} \\ \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right)\right) + a \end{array} \]
                                      (FPCore (x y z t a b c i)
                                       :precision binary64
                                       (+ (fma i y (fma (log y) x (fma (log c) (- b 0.5) z))) a))
                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                      	return fma(i, y, fma(log(y), x, fma(log(c), (b - 0.5), z))) + a;
                                      }
                                      
                                      function code(x, y, z, t, a, b, c, i)
                                      	return Float64(fma(i, y, fma(log(y), x, fma(log(c), Float64(b - 0.5), z))) + a)
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right)\right) + a
                                      \end{array}
                                      
                                      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. Add Preprocessing
                                      3. 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)} \]
                                      4. Step-by-step derivation
                                        1. +-commutativeN/A

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

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

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

                                      Alternative 10: 94.4% accurate, 1.6× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+195} \lor \neg \left(x \leq 3 \cdot 10^{+128}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{\left(z + t\right) + a}{x} + \log y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a b c i)
                                       :precision binary64
                                       (if (or (<= x -9e+195) (not (<= x 3e+128)))
                                         (fma y i (* (+ (/ (+ (+ z t) a) x) (log y)) x))
                                         (+ (+ a t) (fma (log c) (- b 0.5) (fma i y z)))))
                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                      	double tmp;
                                      	if ((x <= -9e+195) || !(x <= 3e+128)) {
                                      		tmp = fma(y, i, (((((z + t) + a) / x) + log(y)) * x));
                                      	} else {
                                      		tmp = (a + t) + fma(log(c), (b - 0.5), fma(i, y, z));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, y, z, t, a, b, c, i)
                                      	tmp = 0.0
                                      	if ((x <= -9e+195) || !(x <= 3e+128))
                                      		tmp = fma(y, i, Float64(Float64(Float64(Float64(Float64(z + t) + a) / x) + log(y)) * x));
                                      	else
                                      		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), fma(i, y, z)));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -9e+195], N[Not[LessEqual[x, 3e+128]], $MachinePrecision]], N[(y * i + N[(N[(N[(N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision] / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;x \leq -9 \cdot 10^{+195} \lor \neg \left(x \leq 3 \cdot 10^{+128}\right):\\
                                      \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{\left(z + t\right) + a}{x} + \log y\right) \cdot x\right)\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if x < -9.00000000000000018e195 or 2.9999999999999998e128 < x

                                        1. Initial program 99.8%

                                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                        2. Add Preprocessing
                                        3. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if -9.00000000000000018e195 < x < 2.9999999999999998e128

                                          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+195} \lor \neg \left(x \leq 3 \cdot 10^{+128}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{\left(z + t\right) + a}{x} + \log y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \]
                                        12. Add Preprocessing

                                        Alternative 11: 91.1% accurate, 1.7× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+196} \lor \neg \left(x \leq 1.05 \cdot 10^{+153}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \end{array} \]
                                        (FPCore (x y z t a b c i)
                                         :precision binary64
                                         (if (or (<= x -4e+196) (not (<= x 1.05e+153)))
                                           (fma y i (* (+ (/ a x) (log y)) x))
                                           (+ (+ a t) (fma (log c) (- b 0.5) (fma i y z)))))
                                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                        	double tmp;
                                        	if ((x <= -4e+196) || !(x <= 1.05e+153)) {
                                        		tmp = fma(y, i, (((a / x) + log(y)) * x));
                                        	} else {
                                        		tmp = (a + t) + fma(log(c), (b - 0.5), fma(i, y, z));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(x, y, z, t, a, b, c, i)
                                        	tmp = 0.0
                                        	if ((x <= -4e+196) || !(x <= 1.05e+153))
                                        		tmp = fma(y, i, Float64(Float64(Float64(a / x) + log(y)) * x));
                                        	else
                                        		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), fma(i, y, z)));
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4e+196], N[Not[LessEqual[x, 1.05e+153]], $MachinePrecision]], N[(y * i + N[(N[(N[(a / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;x \leq -4 \cdot 10^{+196} \lor \neg \left(x \leq 1.05 \cdot 10^{+153}\right):\\
                                        \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if x < -3.9999999999999998e196 or 1.05000000000000008e153 < x

                                          1. Initial program 99.8%

                                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                          2. Add Preprocessing
                                          3. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right) \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites80.7%

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

                                            if -3.9999999999999998e196 < x < 1.05000000000000008e153

                                            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right) \]
                                            5. Applied rewrites97.2%

                                              \[\leadsto \color{blue}{\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)} \]
                                          10. Recombined 2 regimes into one program.
                                          11. Final simplification93.3%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+196} \lor \neg \left(x \leq 1.05 \cdot 10^{+153}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \]
                                          12. Add Preprocessing

                                          Alternative 12: 90.3% accurate, 1.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+199} \lor \neg \left(x \leq 2.55 \cdot 10^{+206}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z t a b c i)
                                           :precision binary64
                                           (if (or (<= x -1.15e+199) (not (<= x 2.55e+206)))
                                             (fma y i (* (log y) x))
                                             (+ (+ a t) (fma (log c) (- b 0.5) (fma i y z)))))
                                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                          	double tmp;
                                          	if ((x <= -1.15e+199) || !(x <= 2.55e+206)) {
                                          		tmp = fma(y, i, (log(y) * x));
                                          	} else {
                                          		tmp = (a + t) + fma(log(c), (b - 0.5), fma(i, y, z));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z, t, a, b, c, i)
                                          	tmp = 0.0
                                          	if ((x <= -1.15e+199) || !(x <= 2.55e+206))
                                          		tmp = fma(y, i, Float64(log(y) * x));
                                          	else
                                          		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), fma(i, y, z)));
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.15e+199], N[Not[LessEqual[x, 2.55e+206]], $MachinePrecision]], N[(y * i + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;x \leq -1.15 \cdot 10^{+199} \lor \neg \left(x \leq 2.55 \cdot 10^{+206}\right):\\
                                          \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if x < -1.14999999999999997e199 or 2.5500000000000002e206 < x

                                            1. Initial program 99.7%

                                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                            2. Add Preprocessing
                                            3. 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.7

                                                \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot \color{blue}{x}\right) \]
                                              3. lower-log.f6480.7

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

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

                                            if -1.14999999999999997e199 < x < 2.5500000000000002e206

                                            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+199} \lor \neg \left(x \leq 2.55 \cdot 10^{+206}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \]
                                          5. Add Preprocessing

                                          Alternative 13: 73.8% accurate, 1.9× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+184} \lor \neg \left(b \leq 8.2 \cdot 10^{+176}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \log c \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z t a b c i)
                                           :precision binary64
                                           (if (or (<= b -2.8e+184) (not (<= b 8.2e+176)))
                                             (fma y i (* (log c) b))
                                             (fma (+ (fma i y t) a) (/ z z) z)))
                                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                          	double tmp;
                                          	if ((b <= -2.8e+184) || !(b <= 8.2e+176)) {
                                          		tmp = fma(y, i, (log(c) * b));
                                          	} else {
                                          		tmp = fma((fma(i, y, t) + a), (z / z), z);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z, t, a, b, c, i)
                                          	tmp = 0.0
                                          	if ((b <= -2.8e+184) || !(b <= 8.2e+176))
                                          		tmp = fma(y, i, Float64(log(c) * b));
                                          	else
                                          		tmp = fma(Float64(fma(i, y, t) + a), Float64(z / z), z);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -2.8e+184], N[Not[LessEqual[b, 8.2e+176]], $MachinePrecision]], N[(y * i + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * y + t), $MachinePrecision] + a), $MachinePrecision] * N[(z / z), $MachinePrecision] + z), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;b \leq -2.8 \cdot 10^{+184} \lor \neg \left(b \leq 8.2 \cdot 10^{+176}\right):\\
                                          \;\;\;\;\mathsf{fma}\left(y, i, \log c \cdot b\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if b < -2.7999999999999999e184 or 8.1999999999999998e176 < b

                                            1. Initial program 99.5%

                                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                            2. Add Preprocessing
                                            3. 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.6

                                                \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(y, i, \log c \cdot \color{blue}{b}\right) \]
                                              3. lower-log.f6483.5

                                                \[\leadsto \mathsf{fma}\left(y, i, \log c \cdot b\right) \]
                                            7. Applied rewrites83.5%

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

                                            if -2.7999999999999999e184 < b < 8.1999999999999998e176

                                            1. Initial program 99.9%

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, t\right) + a}{z}, z, z\right) \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites59.5%

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(i, y, t\right) + a}{z} \cdot z + z \]
                                                3. associate-*l/N/A

                                                  \[\leadsto \frac{\left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot z}{z} + z \]
                                                4. associate-/l*N/A

                                                  \[\leadsto \left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot \frac{z}{z} + z \]
                                                5. lower-fma.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                                6. lower-/.f6477.8

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{\color{blue}{z}}, z\right) \]
                                              3. Applied rewrites77.8%

                                                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                            8. Recombined 2 regimes into one program.
                                            9. Final simplification79.1%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+184} \lor \neg \left(b \leq 8.2 \cdot 10^{+176}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \log c \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\ \end{array} \]
                                            10. Add Preprocessing

                                            Alternative 14: 71.5% accurate, 2.0× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{+219} \lor \neg \left(b \leq 3.6 \cdot 10^{+225}\right):\\ \;\;\;\;\log c \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b c i)
                                             :precision binary64
                                             (if (or (<= b -8.5e+219) (not (<= b 3.6e+225)))
                                               (* (log c) b)
                                               (fma (+ (fma i y t) a) (/ z z) z)))
                                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                            	double tmp;
                                            	if ((b <= -8.5e+219) || !(b <= 3.6e+225)) {
                                            		tmp = log(c) * b;
                                            	} else {
                                            		tmp = fma((fma(i, y, t) + a), (z / z), z);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a, b, c, i)
                                            	tmp = 0.0
                                            	if ((b <= -8.5e+219) || !(b <= 3.6e+225))
                                            		tmp = Float64(log(c) * b);
                                            	else
                                            		tmp = fma(Float64(fma(i, y, t) + a), Float64(z / z), z);
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -8.5e+219], N[Not[LessEqual[b, 3.6e+225]], $MachinePrecision]], N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision], N[(N[(N[(i * y + t), $MachinePrecision] + a), $MachinePrecision] * N[(z / z), $MachinePrecision] + z), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;b \leq -8.5 \cdot 10^{+219} \lor \neg \left(b \leq 3.6 \cdot 10^{+225}\right):\\
                                            \;\;\;\;\log c \cdot b\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if b < -8.5000000000000001e219 or 3.5999999999999998e225 < b

                                              1. Initial program 99.6%

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

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

                                                  \[\leadsto \log c \cdot \color{blue}{b} \]
                                                2. lower-*.f64N/A

                                                  \[\leadsto \log c \cdot \color{blue}{b} \]
                                                3. lower-log.f6481.8

                                                  \[\leadsto \log c \cdot b \]
                                              5. Applied rewrites81.8%

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

                                              if -8.5000000000000001e219 < b < 3.5999999999999998e225

                                              1. Initial program 99.9%

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, t\right) + a}{z}, z, z\right) \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites57.8%

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

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

                                                    \[\leadsto \frac{\mathsf{fma}\left(i, y, t\right) + a}{z} \cdot z + z \]
                                                  3. associate-*l/N/A

                                                    \[\leadsto \frac{\left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot z}{z} + z \]
                                                  4. associate-/l*N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot \frac{z}{z} + z \]
                                                  5. lower-fma.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                                  6. lower-/.f6475.0

                                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{\color{blue}{z}}, z\right) \]
                                                3. Applied rewrites75.0%

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                              8. Recombined 2 regimes into one program.
                                              9. Final simplification76.1%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{+219} \lor \neg \left(b \leq 3.6 \cdot 10^{+225}\right):\\ \;\;\;\;\log c \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)\\ \end{array} \]
                                              10. Add Preprocessing

                                              Alternative 15: 66.7% accurate, 8.7× speedup?

                                              \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right) \end{array} \]
                                              (FPCore (x y z t a b c i)
                                               :precision binary64
                                               (fma (+ (fma i y t) a) (/ z z) z))
                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                              	return fma((fma(i, y, t) + a), (z / z), z);
                                              }
                                              
                                              function code(x, y, z, t, a, b, c, i)
                                              	return fma(Float64(fma(i, y, t) + a), Float64(z / z), z)
                                              end
                                              
                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(i * y + t), $MachinePrecision] + a), $MachinePrecision] * N[(z / z), $MachinePrecision] + z), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{z}, z\right)
                                              \end{array}
                                              
                                              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. Add Preprocessing
                                              3. Taylor expanded in z around inf

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, t\right) + a}{z}, z, z\right) \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites51.2%

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

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

                                                    \[\leadsto \frac{\mathsf{fma}\left(i, y, t\right) + a}{z} \cdot z + z \]
                                                  3. associate-*l/N/A

                                                    \[\leadsto \frac{\left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot z}{z} + z \]
                                                  4. associate-/l*N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(i, y, t\right) + a\right) \cdot \frac{z}{z} + z \]
                                                  5. lower-fma.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                                  6. lower-/.f6466.3

                                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \frac{z}{\color{blue}{z}}, z\right) \]
                                                3. Applied rewrites66.3%

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(i, y, t\right) + a, \color{blue}{\frac{z}{z}}, z\right) \]
                                                4. Add Preprocessing

                                                Alternative 16: 16.0% accurate, 234.0× speedup?

                                                \[\begin{array}{l} \\ a \end{array} \]
                                                (FPCore (x y z t a b c i) :precision binary64 a)
                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                	return a;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(8) function code(x, y, z, t, a, b, c, i)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    real(8), intent (in) :: z
                                                    real(8), intent (in) :: t
                                                    real(8), intent (in) :: a
                                                    real(8), intent (in) :: b
                                                    real(8), intent (in) :: c
                                                    real(8), intent (in) :: i
                                                    code = a
                                                end function
                                                
                                                public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                	return a;
                                                }
                                                
                                                def code(x, y, z, t, a, b, c, i):
                                                	return a
                                                
                                                function code(x, y, z, t, a, b, c, i)
                                                	return a
                                                end
                                                
                                                function tmp = code(x, y, z, t, a, b, c, i)
                                                	tmp = a;
                                                end
                                                
                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := a
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                a
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 99.8%

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

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

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

                                                  Reproduce

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