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

Percentage Accurate: 99.9% → 99.9%
Time: 7.3s
Alternatives: 17
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.9% 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(\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}
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. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 89.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+158} \lor \neg \left(t\_1 \leq 4\right):\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y + x\right) + z\right) - \log t \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- a 0.5) b)))
   (if (or (<= t_1 -2e+158) (not (<= t_1 4.0)))
     (+ (fma (- a 0.5) b y) x)
     (- (+ (+ y x) z) (* (log t) z)))))
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 <= -2e+158) || !(t_1 <= 4.0)) {
		tmp = fma((a - 0.5), b, y) + x;
	} else {
		tmp = ((y + x) + z) - (log(t) * z);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a - 0.5) * b)
	tmp = 0.0
	if ((t_1 <= -2e+158) || !(t_1 <= 4.0))
		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
	else
		tmp = Float64(Float64(Float64(y + x) + z) - Float64(log(t) * z));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+158], N[Not[LessEqual[t$95$1, 4.0]], $MachinePrecision]], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] + z), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+158} \lor \neg \left(t\_1 \leq 4\right):\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\

\mathbf{else}:\\
\;\;\;\;\left(\left(y + x\right) + z\right) - \log t \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.99999999999999991e158 or 4 < (*.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. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
    4. 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.9

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

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

    if -1.99999999999999991e158 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \left(\left(x + y\right) + z\right) - \color{blue}{z} \cdot \log t \]
      4. +-commutativeN/A

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

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

        \[\leadsto \left(\left(y + x\right) + z\right) - \log t \cdot \color{blue}{z} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\left(y + x\right) + z\right) - \log t \cdot \color{blue}{z} \]
      8. lift-log.f6492.7

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

      \[\leadsto \color{blue}{\left(\left(y + x\right) + z\right) - \log t \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.5%

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

Alternative 3: 88.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+118} \lor \neg \left(z \leq 2.4 \cdot 10^{+121}\right):\\
\;\;\;\;\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.8e118 or 2.4e121 < 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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \left(\color{blue}{z} - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b \]
    4. Step-by-step derivation
      1. Applied rewrites89.5%

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

      if -7.8e118 < z < 2.4e121

      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. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
      4. 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--.f6494.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right) + x} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification92.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+118} \lor \neg \left(z \leq 2.4 \cdot 10^{+121}\right):\\ \;\;\;\;\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \end{array} \]
    7. Add Preprocessing

    Alternative 4: 57.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;\left(\left(x + y\right) + z\right) - z \cdot \log t \leq -5 \cdot 10^{-68}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;y + t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (* (- a 0.5) b)))
       (if (<= (- (+ (+ x y) z) (* z (log t))) -5e-68) (+ x t_1) (+ y 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 ((((x + y) + z) - (z * log(t))) <= -5e-68) {
    		tmp = x + t_1;
    	} else {
    		tmp = y + 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 ((((x + y) + z) - (z * log(t))) <= (-5d-68)) then
            tmp = x + t_1
        else
            tmp = y + 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 ((((x + y) + z) - (z * Math.log(t))) <= -5e-68) {
    		tmp = x + t_1;
    	} else {
    		tmp = y + t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	t_1 = (a - 0.5) * b
    	tmp = 0
    	if (((x + y) + z) - (z * math.log(t))) <= -5e-68:
    		tmp = x + t_1
    	else:
    		tmp = y + t_1
    	return tmp
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(a - 0.5) * b)
    	tmp = 0.0
    	if (Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) <= -5e-68)
    		tmp = Float64(x + t_1);
    	else
    		tmp = Float64(y + 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 ((((x + y) + z) - (z * log(t))) <= -5e-68)
    		tmp = x + t_1;
    	else
    		tmp = y + 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[N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-68], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(a - 0.5\right) \cdot b\\
    \mathbf{if}\;\left(\left(x + y\right) + z\right) - z \cdot \log t \leq -5 \cdot 10^{-68}:\\
    \;\;\;\;x + t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;y + t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -4.99999999999999971e-68

      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. Add Preprocessing
      3. Taylor expanded in x around inf

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

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

        if -4.99999999999999971e-68 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t)))

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

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

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

        Alternative 5: 21.6% accurate, 1.0× 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 -5 \cdot 10^{-68}:\\ \;\;\;\;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)) -5e-68) 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)) <= -5e-68) {
        		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)) <= (-5d-68)) 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)) <= -5e-68) {
        		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)) <= -5e-68:
        		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)) <= -5e-68)
        		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)) <= -5e-68)
        		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], -5e-68], 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 -5 \cdot 10^{-68}:\\
        \;\;\;\;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)) < -4.99999999999999971e-68

          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. Add Preprocessing
          3. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x} \]
          4. Step-by-step derivation
            1. Applied rewrites20.2%

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

            if -4.99999999999999971e-68 < (+.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.9%

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

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

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

            Alternative 6: 87.8% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot z\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(a, b, z - t\_1\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y + x\right) + z\right) - t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (let* ((t_1 (* (log t) z)))
               (if (<= z -8.5e+118)
                 (fma a b (- z t_1))
                 (if (<= z 4.5e+138) (+ (fma (- a 0.5) b y) x) (- (+ (+ y x) z) t_1)))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double t_1 = log(t) * z;
            	double tmp;
            	if (z <= -8.5e+118) {
            		tmp = fma(a, b, (z - t_1));
            	} else if (z <= 4.5e+138) {
            		tmp = fma((a - 0.5), b, y) + x;
            	} else {
            		tmp = ((y + x) + z) - t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b)
            	t_1 = Float64(log(t) * z)
            	tmp = 0.0
            	if (z <= -8.5e+118)
            		tmp = fma(a, b, Float64(z - t_1));
            	elseif (z <= 4.5e+138)
            		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
            	else
            		tmp = Float64(Float64(Float64(y + x) + z) - t_1);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -8.5e+118], N[(a * b + N[(z - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+138], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] + z), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \log t \cdot z\\
            \mathbf{if}\;z \leq -8.5 \cdot 10^{+118}:\\
            \;\;\;\;\mathsf{fma}\left(a, b, z - t\_1\right)\\
            
            \mathbf{elif}\;z \leq 4.5 \cdot 10^{+138}:\\
            \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\left(y + x\right) + z\right) - t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if z < -8.50000000000000033e118

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

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

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

                  \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                3. Step-by-step derivation
                  1. Applied rewrites85.1%

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

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

                      \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                    3. lift-*.f64N/A

                      \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                    4. lower-fma.f6485.1

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

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

                      \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                    7. *-commutativeN/A

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

                      \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                    9. lift-*.f6485.1

                      \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                  3. Applied rewrites85.1%

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

                  if -8.50000000000000033e118 < z < 4.49999999999999982e138

                  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. Add Preprocessing
                  3. Taylor expanded in z around 0

                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                  4. 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--.f6494.1

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

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

                  if 4.49999999999999982e138 < z

                  1. Initial program 99.7%

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

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

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

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

                      \[\leadsto \left(\left(x + y\right) + z\right) - \color{blue}{z} \cdot \log t \]
                    4. +-commutativeN/A

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

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

                      \[\leadsto \left(\left(y + x\right) + z\right) - \log t \cdot \color{blue}{z} \]
                    7. lower-*.f64N/A

                      \[\leadsto \left(\left(y + x\right) + z\right) - \log t \cdot \color{blue}{z} \]
                    8. lift-log.f6480.2

                      \[\leadsto \left(\left(y + x\right) + z\right) - \log t \cdot z \]
                  5. Applied rewrites80.2%

                    \[\leadsto \color{blue}{\left(\left(y + x\right) + z\right) - \log t \cdot z} \]
                4. Recombined 3 regimes into one program.
                5. Add Preprocessing

                Alternative 7: 83.9% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+197} \lor \neg \left(z \leq 5.2 \cdot 10^{+138}\right):\\ \;\;\;\;\left(1 - \log t\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (if (or (<= z -3.5e+197) (not (<= z 5.2e+138)))
                   (* (- 1.0 (log t)) z)
                   (+ (fma (- a 0.5) b y) x)))
                double code(double x, double y, double z, double t, double a, double b) {
                	double tmp;
                	if ((z <= -3.5e+197) || !(z <= 5.2e+138)) {
                		tmp = (1.0 - log(t)) * z;
                	} else {
                		tmp = fma((a - 0.5), b, y) + x;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b)
                	tmp = 0.0
                	if ((z <= -3.5e+197) || !(z <= 5.2e+138))
                		tmp = Float64(Float64(1.0 - log(t)) * z);
                	else
                		tmp = Float64(fma(Float64(a - 0.5), b, y) + x);
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.5e+197], N[Not[LessEqual[z, 5.2e+138]], $MachinePrecision]], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -3.5 \cdot 10^{+197} \lor \neg \left(z \leq 5.2 \cdot 10^{+138}\right):\\
                \;\;\;\;\left(1 - \log t\right) \cdot z\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -3.49999999999999999e197 or 5.2000000000000002e138 < 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. Add Preprocessing
                  3. Taylor expanded in z around inf

                    \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} \]
                  4. 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.f6470.7

                      \[\leadsto \left(1 - \log t\right) \cdot z \]
                  5. Applied rewrites70.7%

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

                  if -3.49999999999999999e197 < z < 5.2000000000000002e138

                  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. Add Preprocessing
                  3. Taylor expanded in z around 0

                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                  4. 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--.f6490.6

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+197} \lor \neg \left(z \leq 5.2 \cdot 10^{+138}\right):\\ \;\;\;\;\left(1 - \log t\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\ \end{array} \]
                5. Add Preprocessing

                Alternative 8: 56.5% accurate, 2.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^{+220}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t\_1 \leq 10^{+122}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+255}:\\ \;\;\;\;-0.5 \cdot b\\ \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+220)
                     (* b a)
                     (if (<= t_1 1e+122) (+ y x) (if (<= t_1 5e+255) (* -0.5 b) (* 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+220) {
                		tmp = b * a;
                	} else if (t_1 <= 1e+122) {
                		tmp = y + x;
                	} else if (t_1 <= 5e+255) {
                		tmp = -0.5 * b;
                	} 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 <= (-1d+220)) then
                        tmp = b * a
                    else if (t_1 <= 1d+122) then
                        tmp = y + x
                    else if (t_1 <= 5d+255) then
                        tmp = (-0.5d0) * b
                    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 <= -1e+220) {
                		tmp = b * a;
                	} else if (t_1 <= 1e+122) {
                		tmp = y + x;
                	} else if (t_1 <= 5e+255) {
                		tmp = -0.5 * b;
                	} 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 <= -1e+220:
                		tmp = b * a
                	elif t_1 <= 1e+122:
                		tmp = y + x
                	elif t_1 <= 5e+255:
                		tmp = -0.5 * b
                	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+220)
                		tmp = Float64(b * a);
                	elseif (t_1 <= 1e+122)
                		tmp = Float64(y + x);
                	elseif (t_1 <= 5e+255)
                		tmp = Float64(-0.5 * b);
                	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 <= -1e+220)
                		tmp = b * a;
                	elseif (t_1 <= 1e+122)
                		tmp = y + x;
                	elseif (t_1 <= 5e+255)
                		tmp = -0.5 * b;
                	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, -1e+220], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 1e+122], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+255], N[(-0.5 * b), $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^{+220}:\\
                \;\;\;\;b \cdot a\\
                
                \mathbf{elif}\;t\_1 \leq 10^{+122}:\\
                \;\;\;\;y + x\\
                
                \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+255}:\\
                \;\;\;\;-0.5 \cdot b\\
                
                \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) < -1e220 or 5.0000000000000002e255 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

                  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. Add Preprocessing
                  3. Taylor expanded in a around inf

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

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

                      \[\leadsto b \cdot \color{blue}{a} \]
                  5. Applied rewrites71.8%

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

                  if -1e220 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000001e122

                  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. Add Preprocessing
                  3. Taylor expanded in z around 0

                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                  4. 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--.f6466.0

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

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

                    \[\leadsto y + x \]
                  7. Step-by-step derivation
                    1. Applied rewrites51.2%

                      \[\leadsto y + x \]

                    if 1.00000000000000001e122 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.0000000000000002e255

                    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. Add Preprocessing
                    3. Taylor expanded in b around inf

                      \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
                    4. 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 \color{blue}{b} \]
                      3. lift--.f6462.2

                        \[\leadsto \left(a - 0.5\right) \cdot b \]
                    5. Applied rewrites62.2%

                      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]
                    6. Taylor expanded in a around 0

                      \[\leadsto \frac{-1}{2} \cdot b \]
                    7. Step-by-step derivation
                      1. Applied rewrites48.4%

                        \[\leadsto -0.5 \cdot b \]
                    8. Recombined 3 regimes into one program.
                    9. Add Preprocessing

                    Alternative 9: 70.2% accurate, 3.4× speedup?

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

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

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

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

                          \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                        3. Step-by-step derivation
                          1. Applied rewrites74.0%

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

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

                              \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                            4. lower-fma.f6474.0

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

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

                              \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                            7. *-commutativeN/A

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

                              \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                            9. lift-*.f6474.0

                              \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                          3. Applied rewrites74.0%

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

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

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

                            if -1.0000000000000001e130 < (-.f64 a #s(literal 1/2 binary64)) < -5e18

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                                  3. lift-*.f64N/A

                                    \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                                  4. lower-fma.f6474.1

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

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

                                    \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                                  7. *-commutativeN/A

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

                                    \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                                  9. lift-*.f6474.1

                                    \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                                3. Applied rewrites74.1%

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

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

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

                                  if -5e18 < (-.f64 a #s(literal 1/2 binary64)) < 2e19

                                  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. Add Preprocessing
                                  3. Taylor expanded in z around 0

                                    \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                  4. 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--.f6471.3

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, b, y\right) + x \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites70.5%

                                      \[\leadsto \mathsf{fma}\left(-0.5, b, y\right) + x \]
                                  8. Recombined 3 regimes into one program.
                                  9. Final simplification69.4%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+130}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \mathbf{elif}\;a - 0.5 \leq -5 \cdot 10^{+18}:\\ \;\;\;\;\mathsf{fma}\left(a, b, y\right)\\ \mathbf{elif}\;a - 0.5 \leq 2 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \end{array} \]
                                  10. Add Preprocessing

                                  Alternative 10: 57.6% accurate, 3.7× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+220} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+219}\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a b)
                                   :precision binary64
                                   (let* ((t_1 (* (- a 0.5) b)))
                                     (if (or (<= t_1 -1e+220) (not (<= t_1 2e+219))) (* b a) (+ y x))))
                                  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+220) || !(t_1 <= 2e+219)) {
                                  		tmp = b * a;
                                  	} else {
                                  		tmp = y + x;
                                  	}
                                  	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 <= (-1d+220)) .or. (.not. (t_1 <= 2d+219))) then
                                          tmp = b * a
                                      else
                                          tmp = y + x
                                      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 <= -1e+220) || !(t_1 <= 2e+219)) {
                                  		tmp = b * a;
                                  	} else {
                                  		tmp = y + x;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t, a, b):
                                  	t_1 = (a - 0.5) * b
                                  	tmp = 0
                                  	if (t_1 <= -1e+220) or not (t_1 <= 2e+219):
                                  		tmp = b * a
                                  	else:
                                  		tmp = y + x
                                  	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+220) || !(t_1 <= 2e+219))
                                  		tmp = Float64(b * a);
                                  	else
                                  		tmp = Float64(y + x);
                                  	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 <= -1e+220) || ~((t_1 <= 2e+219)))
                                  		tmp = b * a;
                                  	else
                                  		tmp = y + x;
                                  	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[Or[LessEqual[t$95$1, -1e+220], N[Not[LessEqual[t$95$1, 2e+219]], $MachinePrecision]], N[(b * a), $MachinePrecision], N[(y + x), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := \left(a - 0.5\right) \cdot b\\
                                  \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+220} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+219}\right):\\
                                  \;\;\;\;b \cdot a\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;y + x\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e220 or 1.99999999999999993e219 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

                                    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. Add Preprocessing
                                    3. Taylor expanded in a around inf

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

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

                                        \[\leadsto b \cdot \color{blue}{a} \]
                                    5. Applied rewrites68.2%

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

                                    if -1e220 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999993e219

                                    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. Add Preprocessing
                                    3. Taylor expanded in z around 0

                                      \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                    4. 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--.f6468.6

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

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

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

                                        \[\leadsto y + x \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification53.3%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(a - 0.5\right) \cdot b \leq -1 \cdot 10^{+220} \lor \neg \left(\left(a - 0.5\right) \cdot b \leq 2 \cdot 10^{+219}\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 11: 77.9% accurate, 4.5× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -0.500000005 \lor \neg \left(a - 0.5 \leq -0.4\right):\\ \;\;\;\;\mathsf{fma}\left(a, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, y\right) + x\\ \end{array} \end{array} \]
                                    (FPCore (x y z t a b)
                                     :precision binary64
                                     (if (or (<= (- a 0.5) -0.500000005) (not (<= (- a 0.5) -0.4)))
                                       (+ (fma a b y) x)
                                       (+ (fma -0.5 b y) x)))
                                    double code(double x, double y, double z, double t, double a, double b) {
                                    	double tmp;
                                    	if (((a - 0.5) <= -0.500000005) || !((a - 0.5) <= -0.4)) {
                                    		tmp = fma(a, b, y) + x;
                                    	} else {
                                    		tmp = fma(-0.5, b, y) + x;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, t, a, b)
                                    	tmp = 0.0
                                    	if ((Float64(a - 0.5) <= -0.500000005) || !(Float64(a - 0.5) <= -0.4))
                                    		tmp = Float64(fma(a, b, y) + x);
                                    	else
                                    		tmp = Float64(fma(-0.5, b, y) + x);
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -0.500000005], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * b + y), $MachinePrecision] + x), $MachinePrecision], N[(N[(-0.5 * b + y), $MachinePrecision] + x), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;a - 0.5 \leq -0.500000005 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
                                    \;\;\;\;\mathsf{fma}\left(a, b, y\right) + x\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\mathsf{fma}\left(-0.5, b, y\right) + x\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (-.f64 a #s(literal 1/2 binary64)) < -0.50000000499999997 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

                                      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. Add Preprocessing
                                      3. Taylor expanded in z around 0

                                        \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                      4. 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--.f6482.1

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

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

                                        \[\leadsto \mathsf{fma}\left(a, b, y\right) + x \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites81.8%

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

                                        if -0.50000000499999997 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

                                        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. Add Preprocessing
                                        3. Taylor expanded in z around 0

                                          \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                        4. 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--.f6470.5

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, b, y\right) + x \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites70.4%

                                            \[\leadsto \mathsf{fma}\left(-0.5, b, y\right) + x \]
                                        8. Recombined 2 regimes into one program.
                                        9. Final simplification75.4%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -0.500000005 \lor \neg \left(a - 0.5 \leq -0.4\right):\\ \;\;\;\;\mathsf{fma}\left(a, b, y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, b, y\right) + x\\ \end{array} \]
                                        10. Add Preprocessing

                                        Alternative 12: 50.5% accurate, 4.7× speedup?

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

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

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

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

                                              \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites42.6%

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

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

                                                  \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                                                3. lift-*.f64N/A

                                                  \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                                                4. lower-fma.f6442.6

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

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

                                                  \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                                                7. *-commutativeN/A

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

                                                  \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                                                9. lift-*.f6442.6

                                                  \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                                              3. Applied rewrites42.6%

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

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

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

                                                if -5.99999999999999981e35 < (+.f64 x y) < 1.00000000000000004e62

                                                1. Initial program 99.7%

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

                                                  \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
                                                4. 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 \color{blue}{b} \]
                                                  3. lift--.f6460.7

                                                    \[\leadsto \left(a - 0.5\right) \cdot b \]
                                                5. Applied rewrites60.7%

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

                                                if 1.00000000000000004e62 < (+.f64 x y)

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

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

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

                                                    \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites36.5%

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

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

                                                        \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                                                      3. lift-*.f64N/A

                                                        \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                                                      4. lower-fma.f6436.5

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

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

                                                        \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                                                      7. *-commutativeN/A

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

                                                        \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                                                      9. lift-*.f6436.5

                                                        \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                                                    3. Applied rewrites36.5%

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

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

                                                        \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{y}\right) \]
                                                    6. Recombined 3 regimes into one program.
                                                    7. Final simplification53.0%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -6 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \mathbf{elif}\;x + y \leq 10^{+62}:\\ \;\;\;\;\left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, y\right)\\ \end{array} \]
                                                    8. Add Preprocessing

                                                    Alternative 13: 43.3% accurate, 5.0× speedup?

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

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

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

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

                                                          \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites47.6%

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

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

                                                              \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                                                            3. lift-*.f64N/A

                                                              \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                                                            4. lower-fma.f6447.6

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

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

                                                              \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                                                            7. *-commutativeN/A

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

                                                              \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                                                            9. lift-*.f6447.6

                                                              \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                                                          3. Applied rewrites47.6%

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

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

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

                                                            if -5.00000000000000019e-90 < (+.f64 x y) < 0.5

                                                            1. Initial program 99.7%

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

                                                              \[\leadsto \color{blue}{b \cdot \left(a - \frac{1}{2}\right)} \]
                                                            4. 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 \color{blue}{b} \]
                                                              3. lift--.f6463.1

                                                                \[\leadsto \left(a - 0.5\right) \cdot b \]
                                                            5. Applied rewrites63.1%

                                                              \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b} \]
                                                            6. Taylor expanded in a around 0

                                                              \[\leadsto \frac{-1}{2} \cdot b \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites38.4%

                                                                \[\leadsto -0.5 \cdot b \]

                                                              if 0.5 < (+.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. Add Preprocessing
                                                              3. Taylor expanded in z around inf

                                                                \[\leadsto \left(\color{blue}{z} - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites51.9%

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

                                                                  \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites42.0%

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

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

                                                                      \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                                                                    3. lift-*.f64N/A

                                                                      \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                                                                    4. lower-fma.f6442.0

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

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

                                                                      \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                                                                    7. *-commutativeN/A

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

                                                                      \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                                                                    9. lift-*.f6442.0

                                                                      \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                                                                  3. Applied rewrites42.0%

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

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

                                                                      \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{y}\right) \]
                                                                  6. Recombined 3 regimes into one program.
                                                                  7. Final simplification45.4%

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -5 \cdot 10^{-90}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \mathbf{elif}\;x + y \leq 0.5:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, y\right)\\ \end{array} \]
                                                                  8. Add Preprocessing

                                                                  Alternative 14: 48.4% accurate, 7.9× speedup?

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

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

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

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

                                                                        \[\leadsto \left(z - z \cdot \log t\right) + \color{blue}{a} \cdot b \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites54.6%

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

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

                                                                            \[\leadsto \color{blue}{a \cdot b + \left(z - z \cdot \log t\right)} \]
                                                                          3. lift-*.f64N/A

                                                                            \[\leadsto \color{blue}{a \cdot b} + \left(z - z \cdot \log t\right) \]
                                                                          4. lower-fma.f6454.6

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

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

                                                                            \[\leadsto \mathsf{fma}\left(a, b, z - z \cdot \color{blue}{\log t}\right) \]
                                                                          7. *-commutativeN/A

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

                                                                            \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t} \cdot z\right) \]
                                                                          9. lift-*.f6454.6

                                                                            \[\leadsto \mathsf{fma}\left(a, b, z - \color{blue}{\log t \cdot z}\right) \]
                                                                        3. Applied rewrites54.6%

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

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

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

                                                                          if 4.99999999999999961e80 < (+.f64 x y)

                                                                          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. Add Preprocessing
                                                                          3. Taylor expanded in z around 0

                                                                            \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                                                          4. 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--.f6483.0

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

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

                                                                            \[\leadsto y + x \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites60.3%

                                                                              \[\leadsto y + x \]
                                                                          8. Recombined 2 regimes into one program.
                                                                          9. Final simplification46.0%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq 5 \cdot 10^{+80}:\\ \;\;\;\;\mathsf{fma}\left(a, b, x\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
                                                                          10. Add Preprocessing

                                                                          Alternative 15: 78.4% accurate, 9.7× 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. Add Preprocessing
                                                                          3. Taylor expanded in z around 0

                                                                            \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                                                          4. 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--.f6475.6

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

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

                                                                          Alternative 16: 41.9% accurate, 31.5× 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. Add Preprocessing
                                                                          3. Taylor expanded in z around 0

                                                                            \[\leadsto \color{blue}{x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)} \]
                                                                          4. 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--.f6475.6

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

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

                                                                            \[\leadsto y + x \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites36.8%

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

                                                                            Alternative 17: 21.8% accurate, 126.0× 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. Add Preprocessing
                                                                            3. Taylor expanded in x around inf

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

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

                                                                              Developer Target 1: 99.6% accurate, 0.4× speedup?

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

                                                                              Reproduce

                                                                              ?
                                                                              herbie shell --seed 2025032 
                                                                              (FPCore (x y z t a b)
                                                                                :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
                                                                                :precision binary64
                                                                              
                                                                                :alt
                                                                                (! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
                                                                              
                                                                                (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))