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

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

Specification

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

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

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

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

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 15 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Derivation
  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. Add Preprocessing

Alternative 2: 89.6% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, y + x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -3.99999999999999981e158 or 9.9999999999999999e51 < (*.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 z around 0

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

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

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

      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 0

        \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
      4. Step-by-step derivation
        1. Applied rewrites94.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(1 - \log t, z, y + x\right)} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification91.7%

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

      Alternative 3: 22.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^{-41}:\\ \;\;\;\;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-41) 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-41) {
      		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-41)) 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-41) {
      		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-41:
      		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-41)
      		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-41)
      		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-41], 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^{-41}:\\
      \;\;\;\;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.9999999999999996e-41

        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 x around inf

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

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

          if -4.9999999999999996e-41 < (+.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 rewrites20.9%

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

          Alternative 4: 89.0% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+152} \lor \neg \left(z \leq 1.8 \cdot 10^{+156}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.5 + a, b, \left(1 - \log t\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (if (or (<= z -4.6e+152) (not (<= z 1.8e+156)))
             (fma (+ -0.5 a) b (* (- 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 <= -4.6e+152) || !(z <= 1.8e+156)) {
          		tmp = fma((-0.5 + a), b, ((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 <= -4.6e+152) || !(z <= 1.8e+156))
          		tmp = fma(Float64(-0.5 + a), b, Float64(Float64(1.0 - log(t)) * z));
          	else
          		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.6e+152], N[Not[LessEqual[z, 1.8e+156]], $MachinePrecision]], N[(N[(-0.5 + a), $MachinePrecision] * b + N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -4.6 \cdot 10^{+152} \lor \neg \left(z \leq 1.8 \cdot 10^{+156}\right):\\
          \;\;\;\;\mathsf{fma}\left(-0.5 + a, b, \left(1 - \log t\right) \cdot z\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -4.5999999999999997e152 or 1.79999999999999989e156 < 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 x around 0

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

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

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} + a, b, z \cdot \left(1 - \log t\right)\right) \]
            6. Step-by-step derivation
              1. Applied rewrites86.3%

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

              if -4.5999999999999997e152 < z < 1.79999999999999989e156

              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. Applied rewrites93.8%

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

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

              Alternative 5: 89.0% accurate, 1.0× speedup?

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

                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 rewrites85.6%

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, b, z - \color{blue}{\log t \cdot z}\right) \]
                    7. lower-*.f6485.6

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

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

                  if -4.5999999999999997e152 < z < 1.79999999999999989e156

                  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. Applied rewrites93.8%

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

                    if 1.79999999999999989e156 < 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 x around 0

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} + a, b, z \cdot \left(1 - \log t\right)\right) \]
                    6. Step-by-step derivation
                      1. Applied rewrites87.2%

                        \[\leadsto \mathsf{fma}\left(-0.5 + a, b, \left(1 - \log t\right) \cdot z\right) \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 6: 84.3% accurate, 1.0× speedup?

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

                      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. Applied rewrites95.1%

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

                        if -2.0000000000000001e138 < (+.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 x around 0

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

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

                      Alternative 7: 85.3% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+226} \lor \neg \left(z \leq 1.5 \cdot 10^{+145}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b)
                       :precision binary64
                       (if (or (<= z -2.65e+226) (not (<= z 1.5e+145)))
                         (fma (- 1.0 (log t)) z y)
                         (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 <= -2.65e+226) || !(z <= 1.5e+145)) {
                      		tmp = fma((1.0 - log(t)), z, y);
                      	} else {
                      		tmp = fma((a - 0.5), b, (y + x));
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a, b)
                      	tmp = 0.0
                      	if ((z <= -2.65e+226) || !(z <= 1.5e+145))
                      		tmp = fma(Float64(1.0 - log(t)), z, y);
                      	else
                      		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.65e+226], N[Not[LessEqual[z, 1.5e+145]], $MachinePrecision]], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -2.65 \cdot 10^{+226} \lor \neg \left(z \leq 1.5 \cdot 10^{+145}\right):\\
                      \;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -2.6500000000000002e226 or 1.5000000000000001e145 < 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 x around 0

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

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

                          \[\leadsto \mathsf{fma}\left(1 - \log t, z, y\right) \]
                        6. Step-by-step derivation
                          1. Applied rewrites74.5%

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

                          if -2.6500000000000002e226 < z < 1.5000000000000001e145

                          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. Applied rewrites91.2%

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

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

                          Alternative 8: 99.9% accurate, 1.0× speedup?

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

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

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

                          Alternative 9: 84.3% accurate, 1.0× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{+226} \lor \neg \left(z \leq 1.02 \cdot 10^{+214}\right):\\ \;\;\;\;\left(1 - \log t\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b)
                           :precision binary64
                           (if (or (<= z -3.25e+226) (not (<= z 1.02e+214)))
                             (* (- 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.25e+226) || !(z <= 1.02e+214)) {
                          		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.25e+226) || !(z <= 1.02e+214))
                          		tmp = Float64(Float64(1.0 - log(t)) * z);
                          	else
                          		tmp = fma(Float64(a - 0.5), b, Float64(y + x));
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.25e+226], N[Not[LessEqual[z, 1.02e+214]], $MachinePrecision]], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;z \leq -3.25 \cdot 10^{+226} \lor \neg \left(z \leq 1.02 \cdot 10^{+214}\right):\\
                          \;\;\;\;\left(1 - \log t\right) \cdot z\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(a - 0.5, b, y + x\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if z < -3.24999999999999978e226 or 1.02e214 < 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 z around inf

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

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

                              if -3.24999999999999978e226 < z < 1.02e214

                              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. Applied rewrites89.4%

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

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

                              Alternative 10: 68.2% accurate, 3.1× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+158} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+26}\right):\\ \;\;\;\;y + t\_1\\ \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 -4e+158) (not (<= t_1 5e+26))) (+ y t_1) (+ 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 <= -4e+158) || !(t_1 <= 5e+26)) {
                              		tmp = y + t_1;
                              	} 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 <= (-4d+158)) .or. (.not. (t_1 <= 5d+26))) then
                                      tmp = y + t_1
                                  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 <= -4e+158) || !(t_1 <= 5e+26)) {
                              		tmp = y + t_1;
                              	} 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 <= -4e+158) or not (t_1 <= 5e+26):
                              		tmp = y + t_1
                              	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 <= -4e+158) || !(t_1 <= 5e+26))
                              		tmp = Float64(y + t_1);
                              	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 <= -4e+158) || ~((t_1 <= 5e+26)))
                              		tmp = y + t_1;
                              	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, -4e+158], N[Not[LessEqual[t$95$1, 5e+26]], $MachinePrecision]], N[(y + t$95$1), $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 -4 \cdot 10^{+158} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+26}\right):\\
                              \;\;\;\;y + t\_1\\
                              
                              \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) < -3.99999999999999981e158 or 5.0000000000000001e26 < (*.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 y around inf

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

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

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

                                  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. Applied rewrites68.9%

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

                                      \[\leadsto x + \color{blue}{y} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites63.3%

                                        \[\leadsto y + \color{blue}{x} \]
                                    4. Recombined 2 regimes into one program.
                                    5. Final simplification73.2%

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

                                    Alternative 11: 63.5% accurate, 3.4× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+188} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+48}\right):\\ \;\;\;\;\left(-0.5 + a\right) \cdot b\\ \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 -2e+188) (not (<= t_1 5e+48))) (* (+ -0.5 a) b) (+ 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 <= -2e+188) || !(t_1 <= 5e+48)) {
                                    		tmp = (-0.5 + a) * b;
                                    	} 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 <= (-2d+188)) .or. (.not. (t_1 <= 5d+48))) then
                                            tmp = ((-0.5d0) + a) * b
                                        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 <= -2e+188) || !(t_1 <= 5e+48)) {
                                    		tmp = (-0.5 + a) * b;
                                    	} 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 <= -2e+188) or not (t_1 <= 5e+48):
                                    		tmp = (-0.5 + a) * b
                                    	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 <= -2e+188) || !(t_1 <= 5e+48))
                                    		tmp = Float64(Float64(-0.5 + a) * b);
                                    	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 <= -2e+188) || ~((t_1 <= 5e+48)))
                                    		tmp = (-0.5 + a) * b;
                                    	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, -2e+188], N[Not[LessEqual[t$95$1, 5e+48]], $MachinePrecision]], N[(N[(-0.5 + a), $MachinePrecision] * b), $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 -2 \cdot 10^{+188} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+48}\right):\\
                                    \;\;\;\;\left(-0.5 + a\right) \cdot b\\
                                    
                                    \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) < -2e188 or 4.99999999999999973e48 < (*.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 b around inf

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

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

                                        if -2e188 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999973e48

                                        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. Applied rewrites70.6%

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

                                            \[\leadsto x + \color{blue}{y} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites63.6%

                                              \[\leadsto y + \color{blue}{x} \]
                                          4. Recombined 2 regimes into one program.
                                          5. Final simplification70.2%

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

                                          Alternative 12: 57.9% accurate, 3.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+188} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+148}\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 -2e+188) (not (<= t_1 2e+148))) (* 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 <= -2e+188) || !(t_1 <= 2e+148)) {
                                          		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 <= (-2d+188)) .or. (.not. (t_1 <= 2d+148))) 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 <= -2e+188) || !(t_1 <= 2e+148)) {
                                          		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 <= -2e+188) or not (t_1 <= 2e+148):
                                          		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 <= -2e+188) || !(t_1 <= 2e+148))
                                          		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 <= -2e+188) || ~((t_1 <= 2e+148)))
                                          		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, -2e+188], N[Not[LessEqual[t$95$1, 2e+148]], $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 -2 \cdot 10^{+188} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+148}\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) < -2e188 or 2.0000000000000001e148 < (*.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 a around inf

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

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

                                              if -2e188 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e148

                                              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. Applied rewrites71.4%

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

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

                                                    \[\leadsto y + \color{blue}{x} \]
                                                4. Recombined 2 regimes into one program.
                                                5. Final simplification61.9%

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

                                                Alternative 13: 78.5% accurate, 9.7× speedup?

                                                \[\begin{array}{l} \\ \mathsf{fma}\left(a - 0.5, b, y + x\right) \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 fma(Float64(a - 0.5), b, Float64(y + x))
                                                end
                                                
                                                code[x_, y_, z_, t_, a_, b_] := N[(N[(a - 0.5), $MachinePrecision] * b + N[(y + x), $MachinePrecision]), $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \mathsf{fma}\left(a - 0.5, b, y + x\right)
                                                \end{array}
                                                
                                                Derivation
                                                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. Applied rewrites79.1%

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

                                                  Alternative 14: 42.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.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. Applied rewrites79.1%

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

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

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

                                                      Alternative 15: 22.3% 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.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 x around inf

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

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

                                                        Developer Target 1: 99.5% 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 2025021 
                                                        (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)))