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

Percentage Accurate: 99.8% → 99.9%
Time: 5.3s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
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)
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
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\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 15 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(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
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)
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
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\mathsf{fma}\left(1 - \log t, z, \left(a - 0.5\right) \cdot b\right) + y\right) + x \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (fma (- 1.0 (log t)) z (* (- a 0.5) b)) y) x))
double code(double x, double y, double z, double t, double a, double b) {
	return (fma((1.0 - log(t)), z, ((a - 0.5) * b)) + y) + x;
}
function code(x, y, z, t, a, b)
	return Float64(Float64(fma(Float64(1.0 - log(t)), z, Float64(Float64(a - 0.5) * b)) + y) + x)
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\left(\mathsf{fma}\left(1 - \log t, z, \left(a - 0.5\right) \cdot b\right) + y\right) + x
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(1 - \log t, z, b \cdot \left(a - 0.5\right)\right) + x\\ \mathbf{if}\;z \leq -1.95 \cdot 10^{+76}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+76}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (fma (- 1.0 (log t)) z (* b (- a 0.5))) x)))
   (if (<= z -1.95e+76)
     t_1
     (if (<= z 1.32e+76) (+ (fma (- a 0.5) b y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma((1.0 - log(t)), z, (b * (a - 0.5))) + x;
	double tmp;
	if (z <= -1.95e+76) {
		tmp = t_1;
	} else if (z <= 1.32e+76) {
		tmp = fma((a - 0.5), b, y) + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(fma(Float64(1.0 - log(t)), z, Float64(b * Float64(a - 0.5))) + x)
	tmp = 0.0
	if (z <= -1.95e+76)
		tmp = t_1;
	elseif (z <= 1.32e+76)
		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.95e+76], t$95$1, If[LessEqual[z, 1.32e+76], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, b \cdot \left(a - 0.5\right)\right) + x\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.94999999999999995e76 or 1.31999999999999999e76 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot \left(a - \frac{1}{2}\right) + z \cdot \left(1 - \log t\right)\right) + x \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1 - \log t, z, b \cdot \left(a - 0.5\right)\right) + x \]
    7. Applied rewrites86.6%

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

    if -1.94999999999999995e76 < z < 1.31999999999999999e76

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
      6. lift--.f6495.1

        \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
    4. Applied rewrites95.1%

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

Alternative 3: 87.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(1 - \log t, z, y\right) + x\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{+100}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+142}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (fma (- 1.0 (log t)) z y) x)))
   (if (<= z -4.8e+100)
     t_1
     (if (<= z 1.75e+142) (+ (fma (- a 0.5) b y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma((1.0 - log(t)), z, y) + x;
	double tmp;
	if (z <= -4.8e+100) {
		tmp = t_1;
	} else if (z <= 1.75e+142) {
		tmp = fma((a - 0.5), b, y) + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(fma(Float64(1.0 - log(t)), z, y) + x)
	tmp = 0.0
	if (z <= -4.8e+100)
		tmp = t_1;
	elseif (z <= 1.75e+142)
		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -4.8e+100], t$95$1, If[LessEqual[z, 1.75e+142], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, y\right) + x\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.80000000000000023e100 or 1.74999999999999999e142 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y + \left(1 - \log t\right) \cdot z\right) + x \]
      2. +-commutativeN/A

        \[\leadsto \left(\left(1 - \log t\right) \cdot z + y\right) + x \]
      3. lift-log.f64N/A

        \[\leadsto \left(\left(1 - \log t\right) \cdot z + y\right) + x \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(1 - \log t\right) \cdot z + y\right) + x \]
      5. lift-fma.f6474.7

        \[\leadsto \mathsf{fma}\left(1 - \log t, z, y\right) + x \]
    7. Applied rewrites74.7%

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

    if -4.80000000000000023e100 < z < 1.74999999999999999e142

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
      6. lift--.f6492.8

        \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
    4. Applied rewrites92.8%

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

Alternative 4: 85.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - \log t\right) \cdot z + x\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{+136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (* (- 1.0 (log t)) z) x)))
   (if (<= z -1.45e+136)
     t_1
     (if (<= z 2.05e+157) (+ (fma (- a 0.5) b y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((1.0 - log(t)) * z) + x;
	double tmp;
	if (z <= -1.45e+136) {
		tmp = t_1;
	} else if (z <= 2.05e+157) {
		tmp = fma((a - 0.5), b, y) + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(1.0 - log(t)) * z) + x)
	tmp = 0.0
	if (z <= -1.45e+136)
		tmp = t_1;
	elseif (z <= 2.05e+157)
		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.45e+136], t$95$1, If[LessEqual[z, 2.05e+157], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z + x\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.44999999999999987e136 or 2.05000000000000008e157 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(1 - \log t\right) \cdot z + x \]
      2. lower-*.f64N/A

        \[\leadsto \left(1 - \log t\right) \cdot z + x \]
      3. lift-log.f64N/A

        \[\leadsto \left(1 - \log t\right) \cdot z + x \]
      4. lift--.f6466.8

        \[\leadsto \left(1 - \log t\right) \cdot z + x \]
    7. Applied rewrites66.8%

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

    if -1.44999999999999987e136 < z < 2.05000000000000008e157

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
      6. lift--.f6491.6

        \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
    4. Applied rewrites91.6%

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

Alternative 5: 83.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - \log t\right) \cdot z\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{+136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+239}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- 1.0 (log t)) z)))
   (if (<= z -1.45e+136)
     t_1
     (if (<= z 6.2e+239) (+ (fma (- a 0.5) b y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (1.0 - log(t)) * z;
	double tmp;
	if (z <= -1.45e+136) {
		tmp = t_1;
	} else if (z <= 6.2e+239) {
		tmp = fma((a - 0.5), b, y) + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(1.0 - log(t)) * z)
	tmp = 0.0
	if (z <= -1.45e+136)
		tmp = t_1;
	elseif (z <= 6.2e+239)
		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.45e+136], t$95$1, If[LessEqual[z, 6.2e+239], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+239}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.44999999999999987e136 or 6.20000000000000001e239 < z

    1. Initial program 99.5%

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

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

        \[\leadsto \left(1 - \log t\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(1 - \log t\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(1 - \log t\right) \cdot z \]
      4. lift-log.f6459.9

        \[\leadsto \left(1 - \log t\right) \cdot z \]
    4. Applied rewrites59.9%

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]

    if -1.44999999999999987e136 < z < 6.20000000000000001e239

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
      6. lift--.f6488.4

        \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
    4. Applied rewrites88.4%

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

Alternative 6: 79.1% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a - 0.5, b, y\right) + x \end{array} \]
(FPCore (x y z t a b) :precision binary64 (+ (fma (- a 0.5) b y) x))
double code(double x, double y, double z, double t, double a, double b) {
	return fma((a - 0.5), b, y) + x;
}
function code(x, y, z, t, a, b)
	return Float64(fma(Float64(a - 0.5), b, y) + x)
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(a - 0.5, b, y\right) + x
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
    6. lift--.f6479.1

      \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
  4. Applied rewrites79.1%

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

Alternative 7: 66.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\left(x + y\right) + z\right) - z \cdot \log t \leq 10^{-58}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (- (+ (+ x y) z) (* z (log t))) 1e-58)
   (fma (- a 0.5) b x)
   (fma (- a 0.5) b y)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((((x + y) + z) - (z * log(t))) <= 1e-58) {
		tmp = fma((a - 0.5), b, x);
	} else {
		tmp = fma((a - 0.5), b, y);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) <= 1e-58)
		tmp = fma(Float64(a - 0.5), b, x);
	else
		tmp = fma(Float64(a - 0.5), b, y);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-58], N[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < 1e-58

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{x + \left(a - \frac{1}{2}\right) \cdot b} \]
        2. lift-*.f64N/A

          \[\leadsto x + \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
        3. lift--.f64N/A

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x\right)} \]
        6. lift--.f6460.2

          \[\leadsto \mathsf{fma}\left(\color{blue}{a - 0.5}, b, x\right) \]
      3. Applied rewrites60.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, x\right)} \]

      if 1e-58 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t)))

      1. Initial program 99.8%

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
        6. lift--.f6478.5

          \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
      4. Applied rewrites78.5%

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

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

          \[\leadsto y + \left(a - \frac{1}{2}\right) \cdot b \]
        2. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) \]
        4. lift--.f6457.5

          \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) \]
      7. Applied rewrites57.5%

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

    Alternative 8: 60.1% accurate, 1.7× speedup?

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

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{x} + \left(a - \frac{1}{2}\right) \cdot b \]
      3. Step-by-step derivation
        1. Applied rewrites57.6%

          \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{x + \left(a - \frac{1}{2}\right) \cdot b} \]
          2. lift-*.f64N/A

            \[\leadsto x + \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
          3. lift--.f64N/A

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x\right)} \]
          6. lift--.f6457.6

            \[\leadsto \mathsf{fma}\left(\color{blue}{a - 0.5}, b, x\right) \]
        3. Applied rewrites57.6%

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{a}, b, x\right) \]
        5. Step-by-step derivation
          1. Applied rewrites47.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{a}, b, x\right) \]

          if -2e17 < (+.f64 x y)

          1. Initial program 99.8%

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) + x \]
            6. lift--.f6476.5

              \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) + x \]
          4. Applied rewrites76.5%

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

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

              \[\leadsto y + \left(a - \frac{1}{2}\right) \cdot b \]
            2. +-commutativeN/A

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

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, y\right) \]
            4. lift--.f6460.1

              \[\leadsto \mathsf{fma}\left(a - 0.5, b, y\right) \]
          7. Applied rewrites60.1%

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

        Alternative 9: 58.9% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+156}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+106}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (let* ((t_1 (* (- a 0.5) b)))
           (if (<= t_1 -5e+156) t_1 (if (<= t_1 2e+106) (+ y x) t_1))))
        double code(double x, double y, double z, double t, double a, double b) {
        	double t_1 = (a - 0.5) * b;
        	double tmp;
        	if (t_1 <= -5e+156) {
        		tmp = t_1;
        	} else if (t_1 <= 2e+106) {
        		tmp = y + x;
        	} 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)
        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) :: t_1
            real(8) :: tmp
            t_1 = (a - 0.5d0) * b
            if (t_1 <= (-5d+156)) then
                tmp = t_1
            else if (t_1 <= 2d+106) then
                tmp = y + x
            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 t_1 = (a - 0.5) * b;
        	double tmp;
        	if (t_1 <= -5e+156) {
        		tmp = t_1;
        	} else if (t_1 <= 2e+106) {
        		tmp = y + x;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	t_1 = (a - 0.5) * b
        	tmp = 0
        	if t_1 <= -5e+156:
        		tmp = t_1
        	elif t_1 <= 2e+106:
        		tmp = y + x
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t, a, b)
        	t_1 = Float64(Float64(a - 0.5) * b)
        	tmp = 0.0
        	if (t_1 <= -5e+156)
        		tmp = t_1;
        	elseif (t_1 <= 2e+106)
        		tmp = Float64(y + x);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	t_1 = (a - 0.5) * b;
        	tmp = 0.0;
        	if (t_1 <= -5e+156)
        		tmp = t_1;
        	elseif (t_1 <= 2e+106)
        		tmp = y + x;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+156], t$95$1, If[LessEqual[t$95$1, 2e+106], N[(y + x), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left(a - 0.5\right) \cdot b\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+156}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+106}:\\
        \;\;\;\;y + x\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.99999999999999992e156 or 2.00000000000000018e106 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(a - \frac{1}{2}\right) \cdot \color{blue}{b} \]
            2. lift--.f64N/A

              \[\leadsto \left(a - \frac{1}{2}\right) \cdot b \]
            3. lift-*.f6475.1

              \[\leadsto \left(a - 0.5\right) \cdot \color{blue}{b} \]
          4. Applied rewrites75.1%

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

          if -4.99999999999999992e156 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.00000000000000018e106

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto y + x \]
          6. Step-by-step derivation
            1. Applied rewrites59.6%

              \[\leadsto y + x \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 10: 57.9% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{-36}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \mathbf{elif}\;a \leq -1.8 \cdot 10^{-250}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (if (<= a -3.2e-36)
             (fma a b x)
             (if (<= a -1.8e-250)
               (+ y x)
               (if (<= a 5.4e-5) (fma -0.5 b x) (fma a b x)))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double tmp;
          	if (a <= -3.2e-36) {
          		tmp = fma(a, b, x);
          	} else if (a <= -1.8e-250) {
          		tmp = y + x;
          	} else if (a <= 5.4e-5) {
          		tmp = fma(-0.5, b, x);
          	} else {
          		tmp = fma(a, b, x);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b)
          	tmp = 0.0
          	if (a <= -3.2e-36)
          		tmp = fma(a, b, x);
          	elseif (a <= -1.8e-250)
          		tmp = Float64(y + x);
          	elseif (a <= 5.4e-5)
          		tmp = fma(-0.5, b, x);
          	else
          		tmp = fma(a, b, x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.2e-36], N[(a * b + x), $MachinePrecision], If[LessEqual[a, -1.8e-250], N[(y + x), $MachinePrecision], If[LessEqual[a, 5.4e-5], N[(-0.5 * b + x), $MachinePrecision], N[(a * b + x), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;a \leq -3.2 \cdot 10^{-36}:\\
          \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\
          
          \mathbf{elif}\;a \leq -1.8 \cdot 10^{-250}:\\
          \;\;\;\;y + x\\
          
          \mathbf{elif}\;a \leq 5.4 \cdot 10^{-5}:\\
          \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if a < -3.20000000000000021e-36 or 5.3999999999999998e-5 < a

            1. Initial program 99.8%

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

              \[\leadsto \color{blue}{x} + \left(a - \frac{1}{2}\right) \cdot b \]
            3. Step-by-step derivation
              1. Applied rewrites65.8%

                \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \color{blue}{x + \left(a - \frac{1}{2}\right) \cdot b} \]
                2. lift-*.f64N/A

                  \[\leadsto x + \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
                3. lift--.f64N/A

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x\right)} \]
                6. lift--.f6465.8

                  \[\leadsto \mathsf{fma}\left(\color{blue}{a - 0.5}, b, x\right) \]
              3. Applied rewrites65.8%

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{a}, b, x\right) \]
              5. Step-by-step derivation
                1. Applied rewrites64.1%

                  \[\leadsto \mathsf{fma}\left(\color{blue}{a}, b, x\right) \]

                if -3.20000000000000021e-36 < a < -1.79999999999999991e-250

                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto y + x \]
                6. Step-by-step derivation
                  1. Applied rewrites50.6%

                    \[\leadsto y + x \]

                  if -1.79999999999999991e-250 < a < 5.3999999999999998e-5

                  1. Initial program 99.8%

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

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

                      \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \color{blue}{x + \left(a - \frac{1}{2}\right) \cdot b} \]
                      2. lift-*.f64N/A

                        \[\leadsto x + \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
                      3. lift--.f64N/A

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x\right)} \]
                      6. lift--.f6449.3

                        \[\leadsto \mathsf{fma}\left(\color{blue}{a - 0.5}, b, x\right) \]
                    3. Applied rewrites49.3%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, x\right)} \]
                    4. Taylor expanded in a around 0

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}}, b, x\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites49.1%

                        \[\leadsto \mathsf{fma}\left(\color{blue}{-0.5}, b, x\right) \]
                    6. Recombined 3 regimes into one program.
                    7. Add Preprocessing

                    Alternative 11: 57.3% accurate, 0.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+275}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+158}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+181}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+247}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (let* ((t_1 (* (- a 0.5) b)))
                       (if (<= t_1 -1e+275)
                         (* b a)
                         (if (<= t_1 -4e+158)
                           (fma -0.5 b x)
                           (if (<= t_1 2e+181)
                             (+ y x)
                             (if (<= t_1 5e+247) (fma -0.5 b x) (* b a)))))))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = (a - 0.5) * b;
                    	double tmp;
                    	if (t_1 <= -1e+275) {
                    		tmp = b * a;
                    	} else if (t_1 <= -4e+158) {
                    		tmp = fma(-0.5, b, x);
                    	} else if (t_1 <= 2e+181) {
                    		tmp = y + x;
                    	} else if (t_1 <= 5e+247) {
                    		tmp = fma(-0.5, b, x);
                    	} else {
                    		tmp = b * a;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(Float64(a - 0.5) * b)
                    	tmp = 0.0
                    	if (t_1 <= -1e+275)
                    		tmp = Float64(b * a);
                    	elseif (t_1 <= -4e+158)
                    		tmp = fma(-0.5, b, x);
                    	elseif (t_1 <= 2e+181)
                    		tmp = Float64(y + x);
                    	elseif (t_1 <= 5e+247)
                    		tmp = fma(-0.5, b, x);
                    	else
                    		tmp = Float64(b * a);
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+275], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -4e+158], N[(-0.5 * b + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+181], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+247], N[(-0.5 * b + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \left(a - 0.5\right) \cdot b\\
                    \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+275}:\\
                    \;\;\;\;b \cdot a\\
                    
                    \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+158}:\\
                    \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\
                    
                    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+181}:\\
                    \;\;\;\;y + x\\
                    
                    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+247}:\\
                    \;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;b \cdot a\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.9999999999999996e274 or 5.00000000000000023e247 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

                      1. Initial program 99.9%

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

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

                          \[\leadsto b \cdot \color{blue}{a} \]
                        2. lower-*.f6478.3

                          \[\leadsto b \cdot \color{blue}{a} \]
                      4. Applied rewrites78.3%

                        \[\leadsto \color{blue}{b \cdot a} \]

                      if -9.9999999999999996e274 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -3.99999999999999981e158 or 1.9999999999999998e181 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.00000000000000023e247

                      1. Initial program 99.8%

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

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

                          \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
                        2. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \color{blue}{x + \left(a - \frac{1}{2}\right) \cdot b} \]
                          2. lift-*.f64N/A

                            \[\leadsto x + \color{blue}{\left(a - \frac{1}{2}\right) \cdot b} \]
                          3. lift--.f64N/A

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(a - \frac{1}{2}, b, x\right)} \]
                          6. lift--.f6474.3

                            \[\leadsto \mathsf{fma}\left(\color{blue}{a - 0.5}, b, x\right) \]
                        3. Applied rewrites74.3%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, x\right)} \]
                        4. Taylor expanded in a around 0

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}}, b, x\right) \]
                        5. Step-by-step derivation
                          1. Applied rewrites44.0%

                            \[\leadsto \mathsf{fma}\left(\color{blue}{-0.5}, b, x\right) \]

                          if -3.99999999999999981e158 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e181

                          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto y + x \]
                          6. Step-by-step derivation
                            1. Applied rewrites58.0%

                              \[\leadsto y + x \]
                          7. Recombined 3 regimes into one program.
                          8. Add Preprocessing

                          Alternative 12: 55.6% accurate, 1.1× speedup?

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

                            1. Initial program 99.8%

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

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

                                \[\leadsto b \cdot \color{blue}{a} \]
                              2. lower-*.f6462.2

                                \[\leadsto b \cdot \color{blue}{a} \]
                            4. Applied rewrites62.2%

                              \[\leadsto \color{blue}{b \cdot a} \]

                            if -5.9999999999999995e244 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2e145

                            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto y + x \]
                            6. Step-by-step derivation
                              1. Applied rewrites55.9%

                                \[\leadsto y + x \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 13: 42.4% accurate, 7.0× speedup?

                            \[\begin{array}{l} \\ y + x \end{array} \]
                            (FPCore (x y z t a b) :precision binary64 (+ y x))
                            double code(double x, double y, double z, double t, double a, double b) {
                            	return y + x;
                            }
                            
                            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)
                            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
                                code = y + x
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a, double b) {
                            	return y + x;
                            }
                            
                            def code(x, y, z, t, a, b):
                            	return y + x
                            
                            function code(x, y, z, t, a, b)
                            	return Float64(y + x)
                            end
                            
                            function tmp = code(x, y, z, t, a, b)
                            	tmp = y + x;
                            end
                            
                            code[x_, y_, z_, t_, a_, b_] := N[(y + x), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            y + x
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto y + x \]
                            6. Step-by-step derivation
                              1. Applied rewrites42.4%

                                \[\leadsto y + x \]
                              2. Add Preprocessing

                              Alternative 14: 22.7% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \leq -5000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b)
                               :precision binary64
                               (if (<= (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)) -5000000.0) x y))
                              double code(double x, double y, double z, double t, double a, double b) {
                              	double tmp;
                              	if (((((x + y) + z) - (z * log(t))) + ((a - 0.5) * b)) <= -5000000.0) {
                              		tmp = x;
                              	} else {
                              		tmp = 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)
                              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) :: tmp
                                  if (((((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)) <= (-5000000.0d0)) then
                                      tmp = x
                                  else
                                      tmp = y
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y, double z, double t, double a, double b) {
                              	double tmp;
                              	if (((((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b)) <= -5000000.0) {
                              		tmp = x;
                              	} else {
                              		tmp = y;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t, a, b):
                              	tmp = 0
                              	if ((((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)) <= -5000000.0:
                              		tmp = x
                              	else:
                              		tmp = y
                              	return tmp
                              
                              function code(x, y, z, t, a, b)
                              	tmp = 0.0
                              	if (Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) <= -5000000.0)
                              		tmp = x;
                              	else
                              		tmp = y;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t, a, b)
                              	tmp = 0.0;
                              	if (((((x + y) + z) - (z * log(t))) + ((a - 0.5) * b)) <= -5000000.0)
                              		tmp = x;
                              	else
                              		tmp = y;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], -5000000.0], x, y]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \leq -5000000:\\
                              \;\;\;\;x\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;y\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -5e6

                                1. Initial program 99.9%

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

                                  \[\leadsto \color{blue}{x} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites21.8%

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

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

                                  1. Initial program 99.8%

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

                                    \[\leadsto \color{blue}{y} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites23.5%

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

                                  Alternative 15: 21.5% accurate, 26.1× speedup?

                                  \[\begin{array}{l} \\ x \end{array} \]
                                  (FPCore (x y z t a b) :precision binary64 x)
                                  double code(double x, double y, double z, double t, double a, double b) {
                                  	return x;
                                  }
                                  
                                  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)
                                  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
                                      code = x
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t, double a, double b) {
                                  	return x;
                                  }
                                  
                                  def code(x, y, z, t, a, b):
                                  	return x
                                  
                                  function code(x, y, z, t, a, b)
                                  	return x
                                  end
                                  
                                  function tmp = code(x, y, z, t, a, b)
                                  	tmp = x;
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_] := x
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  x
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 99.8%

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

                                    \[\leadsto \color{blue}{x} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites21.5%

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

                                    Reproduce

                                    ?
                                    herbie shell --seed 2025112 
                                    (FPCore (x y z t a b)
                                      :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
                                      :precision binary64
                                      (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))