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

Percentage Accurate: 99.8% → 99.8%
Time: 6.2s
Alternatives: 14
Speedup: 1.1×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(a + t\right) + \mathsf{fma}\left(\log y, x, z\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(Float64(a + 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[(N[(a + t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(a + t\right) + \mathsf{fma}\left(\log y, x, z\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. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

      \[\leadsto \left(\left(\color{blue}{\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 \]
    6. lift-+.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
    14. *-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. Applied rewrites99.8%

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

Alternative 2: 93.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \mathsf{fma}\left(\log y, x, z\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 (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 + 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 + 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[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \mathsf{fma}\left(\log y, x, z\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. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

      \[\leadsto \left(\left(\color{blue}{\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 \]
    6. lift-+.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
    14. *-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. Applied rewrites99.8%

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

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

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

    Alternative 3: 89.0% accurate, 1.0× speedup?

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

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto \left(\left(\color{blue}{\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 \]
        6. lift-+.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
        14. *-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. Applied rewrites99.8%

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

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

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

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

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

          if -6.70000000000000037e165 < x < 5.8000000000000002e122

          1. Initial program 99.8%

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

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

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

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

              \[\leadsto \left(\left(\color{blue}{\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 \]
            6. lift-+.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
            14. *-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. Applied rewrites99.8%

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

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

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

          Alternative 4: 85.2% accurate, 1.1× speedup?

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

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -4.2000000000000004e53 < z

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto \left(\left(\color{blue}{\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 \]
              6. lift-+.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
              14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 76.9% accurate, 1.2× speedup?

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

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto \left(\left(\color{blue}{\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 \]
              6. lift-+.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
              14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \color{blue}{\log y} \]
              2. lift-log.f6416.5

                \[\leadsto x \cdot \log y \]
            9. Applied rewrites16.5%

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

            if -7.1999999999999998e255 < x < 8.9999999999999997e194

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto \left(\left(\color{blue}{\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 \]
              6. lift-+.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
              14. *-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. Applied rewrites99.8%

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

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

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

              if 8.9999999999999997e194 < x

              1. Initial program 99.8%

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

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

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

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

                  \[\leadsto \left(\left(\color{blue}{\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 \]
                6. lift-+.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot x\right) \]
              11. Step-by-step derivation
                1. lift-log.f6439.2

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

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

            Alternative 6: 75.3% accurate, 1.3× speedup?

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

              1. Initial program 99.8%

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

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

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

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

                  \[\leadsto \left(\left(\color{blue}{\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 \]
                6. lift-+.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x \cdot \color{blue}{\log y} \]
                2. lift-log.f6416.5

                  \[\leadsto x \cdot \log y \]
              9. Applied rewrites16.5%

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

              if -7.1999999999999998e255 < x < 8.9999999999999997e194

              1. Initial program 99.8%

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

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

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

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

                  \[\leadsto \left(\left(\color{blue}{\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 \]
                6. lift-+.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                14. *-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. Applied rewrites99.8%

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

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

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

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

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

                  if 8.9999999999999997e194 < x

                  1. Initial program 99.8%

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

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

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

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

                      \[\leadsto \left(\left(\color{blue}{\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 \]
                    6. lift-+.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                    14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot x\right) \]
                  11. Step-by-step derivation
                    1. lift-log.f6439.2

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

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

                Alternative 7: 61.0% accurate, 1.4× speedup?

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

                  1. Initial program 99.8%

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

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

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

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

                      \[\leadsto \left(\left(\color{blue}{\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 \]
                    6. lift-+.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                    14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto x \cdot \color{blue}{\log y} \]
                    2. lift-log.f6416.5

                      \[\leadsto x \cdot \log y \]
                  9. Applied rewrites16.5%

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

                  if -7.1999999999999998e255 < x < 1.25e136

                  1. Initial program 99.8%

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

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

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

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

                      \[\leadsto \left(\left(\color{blue}{\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 \]
                    6. lift-+.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                    14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 1.25e136 < x

                    1. Initial program 99.8%

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

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

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

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

                        \[\leadsto \left(\left(\color{blue}{\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 \]
                      6. lift-+.f64N/A

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                      14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot x\right) \]
                    11. Step-by-step derivation
                      1. lift-log.f6439.2

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

                      \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot x\right) \]
                  12. Recombined 3 regimes into one program.
                  13. Add Preprocessing

                  Alternative 8: 43.9% 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 -200:\\ \;\;\;\;\left(-y\right) \cdot \left(\left(-\frac{z}{y}\right) + \left(-i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot a + y \cdot i\\ \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))
                        -200.0)
                     (* (- y) (+ (- (/ z y)) (- i)))
                     (+ (* 1.0 a) (* y i))))
                  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)) <= -200.0) {
                  		tmp = -y * (-(z / y) + -i);
                  	} else {
                  		tmp = (1.0 * a) + (y * i);
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z, t, a, b, c, i)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      real(8), intent (in) :: c
                      real(8), intent (in) :: i
                      real(8) :: tmp
                      if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-200.0d0)) then
                          tmp = -y * (-(z / y) + -i)
                      else
                          tmp = (1.0d0 * a) + (y * i)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	double tmp;
                  	if (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -200.0) {
                  		tmp = -y * (-(z / y) + -i);
                  	} else {
                  		tmp = (1.0 * a) + (y * i);
                  	}
                  	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)) <= -200.0:
                  		tmp = -y * (-(z / y) + -i)
                  	else:
                  		tmp = (1.0 * a) + (y * i)
                  	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)) <= -200.0)
                  		tmp = Float64(Float64(-y) * Float64(Float64(-Float64(z / y)) + Float64(-i)));
                  	else
                  		tmp = Float64(Float64(1.0 * a) + Float64(y * i));
                  	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)) <= -200.0)
                  		tmp = -y * (-(z / y) + -i);
                  	else
                  		tmp = (1.0 * a) + (y * i);
                  	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], -200.0], N[((-y) * N[((-N[(z / y), $MachinePrecision]) + (-i)), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 * a), $MachinePrecision] + N[(y * i), $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 -200:\\
                  \;\;\;\;\left(-y\right) \cdot \left(\left(-\frac{z}{y}\right) + \left(-i\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;1 \cdot a + y \cdot i\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200

                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-y\right) \cdot \left(\left(-\frac{z}{y}\right) + \left(-i\right)\right) \]
                    6. Step-by-step derivation
                      1. lower-/.f6433.2

                        \[\leadsto \left(-y\right) \cdot \left(\left(-\frac{z}{y}\right) + \left(-i\right)\right) \]
                    7. Applied rewrites33.2%

                      \[\leadsto \left(-y\right) \cdot \left(\left(-\frac{z}{y}\right) + \left(-i\right)\right) \]

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

                    1. Initial program 99.8%

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

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

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

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

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

                      \[\leadsto 1 \cdot a + y \cdot i \]
                    6. Step-by-step derivation
                      1. Applied rewrites38.9%

                        \[\leadsto 1 \cdot a + y \cdot i \]
                    7. Recombined 2 regimes into one program.
                    8. Add Preprocessing

                    Alternative 9: 36.0% 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 -200:\\ \;\;\;\;\mathsf{fma}\left(y, i, \frac{z}{x} \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot a + y \cdot i\\ \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))
                          -200.0)
                       (fma y i (* (/ z x) x))
                       (+ (* 1.0 a) (* y i))))
                    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)) <= -200.0) {
                    		tmp = fma(y, i, ((z / x) * x));
                    	} else {
                    		tmp = (1.0 * a) + (y * i);
                    	}
                    	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)) <= -200.0)
                    		tmp = fma(y, i, Float64(Float64(z / x) * x));
                    	else
                    		tmp = Float64(Float64(1.0 * a) + Float64(y * i));
                    	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], -200.0], N[(y * i + N[(N[(z / x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 * a), $MachinePrecision] + N[(y * i), $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 -200:\\
                    \;\;\;\;\mathsf{fma}\left(y, i, \frac{z}{x} \cdot x\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;1 \cdot a + y \cdot i\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200

                      1. Initial program 99.8%

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

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

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

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

                          \[\leadsto \left(\left(\color{blue}{\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 \]
                        6. lift-+.f64N/A

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                        14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(y, i, \frac{z}{x} \cdot x\right) \]
                      12. Applied rewrites31.5%

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

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

                      1. Initial program 99.8%

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

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

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

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

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

                        \[\leadsto 1 \cdot a + y \cdot i \]
                      6. Step-by-step derivation
                        1. Applied rewrites38.9%

                          \[\leadsto 1 \cdot a + y \cdot i \]
                      7. Recombined 2 regimes into one program.
                      8. Add Preprocessing

                      Alternative 10: 35.1% accurate, 2.2× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -1.75 \cdot 10^{+246}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+133}:\\ \;\;\;\;1 \cdot a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (let* ((t_1 (* x (log y))))
                         (if (<= x -1.75e+246) t_1 (if (<= x 2.8e+133) (+ (* 1.0 a) (* y i)) t_1))))
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double t_1 = x * log(y);
                      	double tmp;
                      	if (x <= -1.75e+246) {
                      		tmp = t_1;
                      	} else if (x <= 2.8e+133) {
                      		tmp = (1.0 * a) + (y * i);
                      	} else {
                      		tmp = t_1;
                      	}
                      	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)
                          if (x <= (-1.75d+246)) then
                              tmp = t_1
                          else if (x <= 2.8d+133) then
                              tmp = (1.0d0 * a) + (y * i)
                          else
                              tmp = t_1
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double t_1 = x * Math.log(y);
                      	double tmp;
                      	if (x <= -1.75e+246) {
                      		tmp = t_1;
                      	} else if (x <= 2.8e+133) {
                      		tmp = (1.0 * a) + (y * i);
                      	} else {
                      		tmp = t_1;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a, b, c, i):
                      	t_1 = x * math.log(y)
                      	tmp = 0
                      	if x <= -1.75e+246:
                      		tmp = t_1
                      	elif x <= 2.8e+133:
                      		tmp = (1.0 * a) + (y * i)
                      	else:
                      		tmp = t_1
                      	return tmp
                      
                      function code(x, y, z, t, a, b, c, i)
                      	t_1 = Float64(x * log(y))
                      	tmp = 0.0
                      	if (x <= -1.75e+246)
                      		tmp = t_1;
                      	elseif (x <= 2.8e+133)
                      		tmp = Float64(Float64(1.0 * a) + Float64(y * i));
                      	else
                      		tmp = t_1;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a, b, c, i)
                      	t_1 = x * log(y);
                      	tmp = 0.0;
                      	if (x <= -1.75e+246)
                      		tmp = t_1;
                      	elseif (x <= 2.8e+133)
                      		tmp = (1.0 * a) + (y * i);
                      	else
                      		tmp = t_1;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+246], t$95$1, If[LessEqual[x, 2.8e+133], N[(N[(1.0 * a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := x \cdot \log y\\
                      \mathbf{if}\;x \leq -1.75 \cdot 10^{+246}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;x \leq 2.8 \cdot 10^{+133}:\\
                      \;\;\;\;1 \cdot a + y \cdot i\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if x < -1.74999999999999988e246 or 2.80000000000000016e133 < x

                        1. Initial program 99.8%

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

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

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

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

                            \[\leadsto \left(\left(\color{blue}{\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 \]
                          6. lift-+.f64N/A

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right)} \]
                          14. *-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. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto x \cdot \color{blue}{\log y} \]
                          2. lift-log.f6416.5

                            \[\leadsto x \cdot \log y \]
                        9. Applied rewrites16.5%

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

                        if -1.74999999999999988e246 < x < 2.80000000000000016e133

                        1. Initial program 99.8%

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

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

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

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

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

                          \[\leadsto 1 \cdot a + y \cdot i \]
                        6. Step-by-step derivation
                          1. Applied rewrites38.9%

                            \[\leadsto 1 \cdot a + y \cdot i \]
                        7. Recombined 2 regimes into one program.
                        8. Add Preprocessing

                        Alternative 11: 31.1% accurate, 0.4× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+305}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq 50:\\ \;\;\;\;\frac{z}{y} \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 \cdot a + y \cdot i\\ \end{array} \end{array} \]
                        (FPCore (x y z t a b c i)
                         :precision binary64
                         (let* ((t_1
                                 (+
                                  (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                  (* y i))))
                           (if (<= t_1 -1e+305)
                             (* i y)
                             (if (<= t_1 50.0) (* (/ z y) y) (+ (* 1.0 a) (* y i))))))
                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                        	double tmp;
                        	if (t_1 <= -1e+305) {
                        		tmp = i * y;
                        	} else if (t_1 <= 50.0) {
                        		tmp = (z / y) * y;
                        	} else {
                        		tmp = (1.0 * a) + (y * i);
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t, a, b, c, i)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8), intent (in) :: a
                            real(8), intent (in) :: b
                            real(8), intent (in) :: c
                            real(8), intent (in) :: i
                            real(8) :: t_1
                            real(8) :: tmp
                            t_1 = (((((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 <= 50.0d0) then
                                tmp = (z / y) * y
                            else
                                tmp = (1.0d0 * a) + (y * i)
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	double 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 <= 50.0) {
                        		tmp = (z / y) * y;
                        	} else {
                        		tmp = (1.0 * a) + (y * i);
                        	}
                        	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 <= 50.0:
                        		tmp = (z / y) * y
                        	else:
                        		tmp = (1.0 * a) + (y * i)
                        	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 <= 50.0)
                        		tmp = Float64(Float64(z / y) * y);
                        	else
                        		tmp = Float64(Float64(1.0 * a) + Float64(y * i));
                        	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 <= 50.0)
                        		tmp = (z / y) * y;
                        	else
                        		tmp = (1.0 * a) + (y * i);
                        	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, 50.0], N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision], N[(N[(1.0 * a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                        \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+305}:\\
                        \;\;\;\;i \cdot y\\
                        
                        \mathbf{elif}\;t\_1 \leq 50:\\
                        \;\;\;\;\frac{z}{y} \cdot y\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;1 \cdot a + y \cdot i\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -9.9999999999999994e304

                          1. Initial program 99.8%

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

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

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

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

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

                            \[\leadsto i \cdot y \]
                          6. Step-by-step derivation
                            1. Applied rewrites24.8%

                              \[\leadsto 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)) < 50

                            1. Initial program 99.8%

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

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

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

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

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

                              \[\leadsto i \cdot y \]
                            6. Step-by-step derivation
                              1. Applied rewrites24.8%

                                \[\leadsto i \cdot y \]
                              2. Taylor expanded in z around inf

                                \[\leadsto \frac{z}{y} \cdot y \]
                              3. Step-by-step derivation
                                1. lower-/.f6410.5

                                  \[\leadsto \frac{z}{y} \cdot y \]
                              4. Applied rewrites10.5%

                                \[\leadsto \frac{z}{y} \cdot y \]

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

                              1. Initial program 99.8%

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

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

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

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

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

                                \[\leadsto 1 \cdot a + y \cdot i \]
                              6. Step-by-step derivation
                                1. Applied rewrites38.9%

                                  \[\leadsto 1 \cdot a + y \cdot i \]
                              7. Recombined 3 regimes into one program.
                              8. Add Preprocessing

                              Alternative 12: 25.6% 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 -200:\\ \;\;\;\;\frac{z}{y} \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{y} \cdot y\\ \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 -200.0)
                                     (* (/ z y) y)
                                     (if (<= t_1 1e+305) (* (/ a y) y) (* 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 <= -200.0) {
                              		tmp = (z / y) * y;
                              	} else if (t_1 <= 1e+305) {
                              		tmp = (a / y) * y;
                              	} 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 <= (-200.0d0)) then
                                      tmp = (z / y) * y
                                  else if (t_1 <= 1d+305) then
                                      tmp = (a / y) * y
                                  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 <= -200.0) {
                              		tmp = (z / y) * y;
                              	} else if (t_1 <= 1e+305) {
                              		tmp = (a / y) * y;
                              	} 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 <= -200.0:
                              		tmp = (z / y) * y
                              	elif t_1 <= 1e+305:
                              		tmp = (a / y) * y
                              	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 <= -200.0)
                              		tmp = Float64(Float64(z / y) * y);
                              	elseif (t_1 <= 1e+305)
                              		tmp = Float64(Float64(a / y) * y);
                              	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 <= -200.0)
                              		tmp = (z / y) * y;
                              	elseif (t_1 <= 1e+305)
                              		tmp = (a / y) * y;
                              	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, -200.0], N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+305], N[(N[(a / y), $MachinePrecision] * y), $MachinePrecision], 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 -200:\\
                              \;\;\;\;\frac{z}{y} \cdot y\\
                              
                              \mathbf{elif}\;t\_1 \leq 10^{+305}:\\
                              \;\;\;\;\frac{a}{y} \cdot y\\
                              
                              \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.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))

                                1. Initial program 99.8%

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

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

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

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

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

                                  \[\leadsto i \cdot y \]
                                6. Step-by-step derivation
                                  1. Applied rewrites24.8%

                                    \[\leadsto 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)) < -200

                                  1. Initial program 99.8%

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

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

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

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

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

                                    \[\leadsto i \cdot y \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites24.8%

                                      \[\leadsto i \cdot y \]
                                    2. Taylor expanded in z around inf

                                      \[\leadsto \frac{z}{y} \cdot y \]
                                    3. Step-by-step derivation
                                      1. lower-/.f6410.5

                                        \[\leadsto \frac{z}{y} \cdot y \]
                                    4. Applied rewrites10.5%

                                      \[\leadsto \frac{z}{y} \cdot y \]

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

                                    1. Initial program 99.8%

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

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

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

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

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

                                      \[\leadsto i \cdot y \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites24.8%

                                        \[\leadsto i \cdot y \]
                                      2. Taylor expanded in a around inf

                                        \[\leadsto \frac{a}{y} \cdot y \]
                                      3. Step-by-step derivation
                                        1. lower-/.f6410.5

                                          \[\leadsto \frac{a}{y} \cdot y \]
                                      4. Applied rewrites10.5%

                                        \[\leadsto \frac{a}{y} \cdot y \]
                                    7. Recombined 3 regimes into one program.
                                    8. Add Preprocessing

                                    Alternative 13: 24.8% accurate, 3.4× speedup?

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

                                      1. Initial program 99.8%

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

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

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

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

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

                                        \[\leadsto i \cdot y \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites24.8%

                                          \[\leadsto i \cdot y \]

                                        if 1.9e195 < a

                                        1. Initial program 99.8%

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

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

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

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

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

                                          \[\leadsto i \cdot y \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites24.8%

                                            \[\leadsto i \cdot y \]
                                          2. Taylor expanded in a around inf

                                            \[\leadsto \frac{a}{y} \cdot y \]
                                          3. Step-by-step derivation
                                            1. lower-/.f6410.5

                                              \[\leadsto \frac{a}{y} \cdot y \]
                                          4. Applied rewrites10.5%

                                            \[\leadsto \frac{a}{y} \cdot y \]
                                        7. Recombined 2 regimes into one program.
                                        8. Add Preprocessing

                                        Alternative 14: 22.6% accurate, 9.5× speedup?

                                        \[\begin{array}{l} \\ i \cdot y \end{array} \]
                                        (FPCore (x y z t a b c i) :precision binary64 (* i y))
                                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                        	return i * y;
                                        }
                                        
                                        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 = i * y
                                        end function
                                        
                                        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                        	return i * y;
                                        }
                                        
                                        def code(x, y, z, t, a, b, c, i):
                                        	return i * y
                                        
                                        function code(x, y, z, t, a, b, c, i)
                                        	return Float64(i * y)
                                        end
                                        
                                        function tmp = code(x, y, z, t, a, b, c, i)
                                        	tmp = i * y;
                                        end
                                        
                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        i \cdot y
                                        \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. Taylor expanded in y around inf

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

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

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

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

                                          \[\leadsto i \cdot y \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites24.8%

                                            \[\leadsto i \cdot y \]
                                          2. Add Preprocessing

                                          Reproduce

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