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

Percentage Accurate: 99.8% → 99.8%
Time: 5.7s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
(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]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b

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 11 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?

\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
(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]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b

Alternative 1: 92.8% accurate, 0.8× speedup?

\[\begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ t_2 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+136}:\\ \;\;\;\;x + \left(y + t\_1\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+224}:\\ \;\;\;\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + -0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(1 + \left(\frac{x}{t\_1} + \frac{y}{t\_1}\right)\right) \cdot \left(a - 0.5\right)\right)\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (* b (- a 0.5))) (t_2 (* (- a 0.5) b)))
  (if (<= t_2 -5e+136)
    (+ x (+ y t_1))
    (if (<= t_2 1e+224)
      (+ (- (+ (+ x y) z) (* z (log t))) (* -0.5 b))
      (* b (* (+ 1.0 (+ (/ x t_1) (/ y t_1))) (- a 0.5)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double t_2 = (a - 0.5) * b;
	double tmp;
	if (t_2 <= -5e+136) {
		tmp = x + (y + t_1);
	} else if (t_2 <= 1e+224) {
		tmp = (((x + y) + z) - (z * log(t))) + (-0.5 * b);
	} else {
		tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5));
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = b * (a - 0.5d0)
    t_2 = (a - 0.5d0) * b
    if (t_2 <= (-5d+136)) then
        tmp = x + (y + t_1)
    else if (t_2 <= 1d+224) then
        tmp = (((x + y) + z) - (z * log(t))) + ((-0.5d0) * b)
    else
        tmp = b * ((1.0d0 + ((x / t_1) + (y / t_1))) * (a - 0.5d0))
    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 = b * (a - 0.5);
	double t_2 = (a - 0.5) * b;
	double tmp;
	if (t_2 <= -5e+136) {
		tmp = x + (y + t_1);
	} else if (t_2 <= 1e+224) {
		tmp = (((x + y) + z) - (z * Math.log(t))) + (-0.5 * b);
	} else {
		tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	t_2 = (a - 0.5) * b
	tmp = 0
	if t_2 <= -5e+136:
		tmp = x + (y + t_1)
	elif t_2 <= 1e+224:
		tmp = (((x + y) + z) - (z * math.log(t))) + (-0.5 * b)
	else:
		tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	t_2 = Float64(Float64(a - 0.5) * b)
	tmp = 0.0
	if (t_2 <= -5e+136)
		tmp = Float64(x + Float64(y + t_1));
	elseif (t_2 <= 1e+224)
		tmp = Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(-0.5 * b));
	else
		tmp = Float64(b * Float64(Float64(1.0 + Float64(Float64(x / t_1) + Float64(y / t_1))) * Float64(a - 0.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	t_2 = (a - 0.5) * b;
	tmp = 0.0;
	if (t_2 <= -5e+136)
		tmp = x + (y + t_1);
	elseif (t_2 <= 1e+224)
		tmp = (((x + y) + z) - (z * log(t))) + (-0.5 * b);
	else
		tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+136], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+224], N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(1.0 + N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+136}:\\
\;\;\;\;x + \left(y + t\_1\right)\\

\mathbf{elif}\;t\_2 \leq 10^{+224}:\\
\;\;\;\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + -0.5 \cdot b\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(1 + \left(\frac{x}{t\_1} + \frac{y}{t\_1}\right)\right) \cdot \left(a - 0.5\right)\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000002e136

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
      4. lower--.f6479.0%

        \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
    4. Applied rewrites79.0%

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

    if -5.0000000000000002e136 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999997e223

    1. Initial program 99.8%

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

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

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

      if 9.9999999999999997e223 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

      1. Initial program 99.8%

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

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

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

          \[\leadsto \left(a - \frac{1}{2}\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \log t - \left(\left(x + y\right) + z\right)\right)\right)\right)} \]
        5. sub-flip-reverseN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto b \cdot \left(\left(1 + \left(\frac{x}{b \cdot \left(a - \frac{1}{2}\right)} + \frac{y}{b \cdot \left(a - \frac{1}{2}\right)}\right)\right) \cdot \left(a - \frac{1}{2}\right)\right) \]
        11. lower--.f6462.2%

          \[\leadsto b \cdot \left(\left(1 + \left(\frac{x}{b \cdot \left(a - 0.5\right)} + \frac{y}{b \cdot \left(a - 0.5\right)}\right)\right) \cdot \left(a - \color{blue}{0.5}\right)\right) \]
      6. Applied rewrites62.2%

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

    Alternative 2: 88.1% accurate, 0.5× speedup?

    \[\begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+84}:\\ \;\;\;\;\mathsf{min}\left(x, y\right) + \left(\mathsf{max}\left(x, y\right) + b \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{min}\left(x, y\right) + z\right) - z \cdot \log t\right) + -0.5 \cdot b\\ \end{array} \]
    (FPCore (x y z t a b)
      :precision binary64
      (if (<= z -1.9e+196)
      (+ (* z (- 1.0 (log t))) (* (- a 0.5) b))
      (if (<= z 1.16e+84)
        (+ (fmin x y) (+ (fmax x y) (* b (- a 0.5))))
        (+ (- (+ (fmin x y) z) (* z (log t))) (* -0.5 b)))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -1.9e+196) {
    		tmp = (z * (1.0 - log(t))) + ((a - 0.5) * b);
    	} else if (z <= 1.16e+84) {
    		tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5)));
    	} else {
    		tmp = ((fmin(x, y) + z) - (z * log(t))) + (-0.5 * b);
    	}
    	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 (z <= (-1.9d+196)) then
            tmp = (z * (1.0d0 - log(t))) + ((a - 0.5d0) * b)
        else if (z <= 1.16d+84) then
            tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5d0)))
        else
            tmp = ((fmin(x, y) + z) - (z * log(t))) + ((-0.5d0) * b)
        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 (z <= -1.9e+196) {
    		tmp = (z * (1.0 - Math.log(t))) + ((a - 0.5) * b);
    	} else if (z <= 1.16e+84) {
    		tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5)));
    	} else {
    		tmp = ((fmin(x, y) + z) - (z * Math.log(t))) + (-0.5 * b);
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	tmp = 0
    	if z <= -1.9e+196:
    		tmp = (z * (1.0 - math.log(t))) + ((a - 0.5) * b)
    	elif z <= 1.16e+84:
    		tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5)))
    	else:
    		tmp = ((fmin(x, y) + z) - (z * math.log(t))) + (-0.5 * b)
    	return tmp
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -1.9e+196)
    		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(Float64(a - 0.5) * b));
    	elseif (z <= 1.16e+84)
    		tmp = Float64(fmin(x, y) + Float64(fmax(x, y) + Float64(b * Float64(a - 0.5))));
    	else
    		tmp = Float64(Float64(Float64(fmin(x, y) + z) - Float64(z * log(t))) + Float64(-0.5 * b));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	tmp = 0.0;
    	if (z <= -1.9e+196)
    		tmp = (z * (1.0 - log(t))) + ((a - 0.5) * b);
    	elseif (z <= 1.16e+84)
    		tmp = min(x, y) + (max(x, y) + (b * (a - 0.5)));
    	else
    		tmp = ((min(x, y) + z) - (z * log(t))) + (-0.5 * b);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e+196], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e+84], N[(N[Min[x, y], $MachinePrecision] + N[(N[Max[x, y], $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Min[x, y], $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    \mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\
    \;\;\;\;z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b\\
    
    \mathbf{elif}\;z \leq 1.16 \cdot 10^{+84}:\\
    \;\;\;\;\mathsf{min}\left(x, y\right) + \left(\mathsf{max}\left(x, y\right) + b \cdot \left(a - 0.5\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\mathsf{min}\left(x, y\right) + z\right) - z \cdot \log t\right) + -0.5 \cdot b\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -1.9000000000000001e196

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b \]
      4. Applied rewrites58.4%

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

      if -1.9000000000000001e196 < z < 1.16e84

      1. Initial program 99.8%

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

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

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

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

          \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
        4. lower--.f6479.0%

          \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
      4. Applied rewrites79.0%

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

      if 1.16e84 < z

      1. Initial program 99.8%

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

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

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

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

            \[\leadsto \left(\left(x + \color{blue}{z}\right) - z \cdot \log t\right) + -0.5 \cdot b \]
        4. Applied rewrites54.0%

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

      Alternative 3: 86.3% accurate, 1.0× speedup?

      \[\begin{array}{l} t_1 := z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\ \;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (+ (* z (- 1.0 (log t))) (* (- a 0.5) b))))
        (if (<= z -1.9e+196)
          t_1
          (if (<= z 7.4e+86) (+ x (+ y (* b (- a 0.5)))) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (z * (1.0 - log(t))) + ((a - 0.5) * b);
      	double tmp;
      	if (z <= -1.9e+196) {
      		tmp = t_1;
      	} else if (z <= 7.4e+86) {
      		tmp = x + (y + (b * (a - 0.5)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (z * (1.0d0 - log(t))) + ((a - 0.5d0) * b)
          if (z <= (-1.9d+196)) then
              tmp = t_1
          else if (z <= 7.4d+86) then
              tmp = x + (y + (b * (a - 0.5d0)))
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (z * (1.0 - Math.log(t))) + ((a - 0.5) * b);
      	double tmp;
      	if (z <= -1.9e+196) {
      		tmp = t_1;
      	} else if (z <= 7.4e+86) {
      		tmp = x + (y + (b * (a - 0.5)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = (z * (1.0 - math.log(t))) + ((a - 0.5) * b)
      	tmp = 0
      	if z <= -1.9e+196:
      		tmp = t_1
      	elif z <= 7.4e+86:
      		tmp = x + (y + (b * (a - 0.5)))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(Float64(a - 0.5) * b))
      	tmp = 0.0
      	if (z <= -1.9e+196)
      		tmp = t_1;
      	elseif (z <= 7.4e+86)
      		tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5))));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = (z * (1.0 - log(t))) + ((a - 0.5) * b);
      	tmp = 0.0;
      	if (z <= -1.9e+196)
      		tmp = t_1;
      	elseif (z <= 7.4e+86)
      		tmp = x + (y + (b * (a - 0.5)));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+196], t$95$1, If[LessEqual[z, 7.4e+86], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      t_1 := z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b\\
      \mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\
      \;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.9000000000000001e196 or 7.3999999999999998e86 < z

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b \]
        4. Applied rewrites58.4%

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

        if -1.9000000000000001e196 < z < 7.3999999999999998e86

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
          4. lower--.f6479.0%

            \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
        4. Applied rewrites79.0%

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

      Alternative 4: 81.0% accurate, 1.0× speedup?

      \[\begin{array}{l} t_1 := \left(1 - \log t\right) \cdot z\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\ \;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (* (- 1.0 (log t)) z)))
        (if (<= z -1.9e+196)
          t_1
          (if (<= z 7.4e+86) (+ x (+ y (* b (- a 0.5)))) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (1.0 - log(t)) * z;
      	double tmp;
      	if (z <= -1.9e+196) {
      		tmp = t_1;
      	} else if (z <= 7.4e+86) {
      		tmp = x + (y + (b * (a - 0.5)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (1.0d0 - log(t)) * z
          if (z <= (-1.9d+196)) then
              tmp = t_1
          else if (z <= 7.4d+86) then
              tmp = x + (y + (b * (a - 0.5d0)))
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (1.0 - Math.log(t)) * z;
      	double tmp;
      	if (z <= -1.9e+196) {
      		tmp = t_1;
      	} else if (z <= 7.4e+86) {
      		tmp = x + (y + (b * (a - 0.5)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = (1.0 - math.log(t)) * z
      	tmp = 0
      	if z <= -1.9e+196:
      		tmp = t_1
      	elif z <= 7.4e+86:
      		tmp = x + (y + (b * (a - 0.5)))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(Float64(1.0 - log(t)) * z)
      	tmp = 0.0
      	if (z <= -1.9e+196)
      		tmp = t_1;
      	elseif (z <= 7.4e+86)
      		tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5))));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = (1.0 - log(t)) * z;
      	tmp = 0.0;
      	if (z <= -1.9e+196)
      		tmp = t_1;
      	elseif (z <= 7.4e+86)
      		tmp = x + (y + (b * (a - 0.5)));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.9e+196], t$95$1, If[LessEqual[z, 7.4e+86], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      t_1 := \left(1 - \log t\right) \cdot z\\
      \mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\
      \;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.9000000000000001e196 or 7.3999999999999998e86 < z

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
          4. lower--.f6479.0%

            \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
        4. Applied rewrites79.0%

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

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

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

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

            \[\leadsto z \cdot \left(1 + -1 \cdot \color{blue}{\log t}\right) \]
          4. lower-log.f6422.0%

            \[\leadsto z \cdot \left(1 + -1 \cdot \log t\right) \]
        7. Applied rewrites22.0%

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

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

            \[\leadsto \left(1 + -1 \cdot \log t\right) \cdot \color{blue}{z} \]
          3. lower-*.f6422.0%

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

            \[\leadsto \left(1 + -1 \cdot \log t\right) \cdot z \]
          5. add-flipN/A

            \[\leadsto \left(1 - \left(\mathsf{neg}\left(-1 \cdot \log t\right)\right)\right) \cdot z \]
          6. lower--.f64N/A

            \[\leadsto \left(1 - \left(\mathsf{neg}\left(-1 \cdot \log t\right)\right)\right) \cdot z \]
          7. lift-*.f64N/A

            \[\leadsto \left(1 - \left(\mathsf{neg}\left(-1 \cdot \log t\right)\right)\right) \cdot z \]
          8. distribute-lft-neg-outN/A

            \[\leadsto \left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \log t\right) \cdot z \]
          9. metadata-evalN/A

            \[\leadsto \left(1 - 1 \cdot \log t\right) \cdot z \]
          10. *-lft-identity22.0%

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

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

        if -1.9000000000000001e196 < z < 7.3999999999999998e86

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
          4. lower--.f6479.0%

            \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
        4. Applied rewrites79.0%

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

      Alternative 5: 79.0% accurate, 8.4× speedup?

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

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

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

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

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

          \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
        4. lower--.f6479.0%

          \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
      4. Applied rewrites79.0%

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

      Alternative 6: 78.3% accurate, 0.3× speedup?

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

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
          4. lower--.f6479.0%

            \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
        4. Applied rewrites79.0%

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

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

            \[\leadsto x + b \cdot \left(a - \color{blue}{\frac{1}{2}}\right) \]
          2. lower--.f6458.1%

            \[\leadsto x + b \cdot \left(a - 0.5\right) \]
        7. Applied rewrites58.1%

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

        if -5e-117 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t)))

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
          4. lower--.f6479.0%

            \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
        4. Applied rewrites79.0%

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

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

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

            \[\leadsto y + b \cdot \left(a - \color{blue}{\frac{1}{2}}\right) \]
          3. lower--.f6458.8%

            \[\leadsto y + b \cdot \left(a - 0.5\right) \]
        7. Applied rewrites58.8%

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

      Alternative 7: 65.4% accurate, 0.3× speedup?

      \[\begin{array}{l} \mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -1 \cdot 10^{+153}:\\ \;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(x, y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (if (<= (- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t))) -1e+153)
        (* 1.0 (fmin x y))
        (+ (fmax x y) (* b (- a 0.5)))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= -1e+153) {
      		tmp = 1.0 * fmin(x, y);
      	} else {
      		tmp = fmax(x, y) + (b * (a - 0.5));
      	}
      	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 ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= (-1d+153)) then
              tmp = 1.0d0 * fmin(x, y)
          else
              tmp = fmax(x, y) + (b * (a - 0.5d0))
          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 ((((fmin(x, y) + fmax(x, y)) + z) - (z * Math.log(t))) <= -1e+153) {
      		tmp = 1.0 * fmin(x, y);
      	} else {
      		tmp = fmax(x, y) + (b * (a - 0.5));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	tmp = 0
      	if (((fmin(x, y) + fmax(x, y)) + z) - (z * math.log(t))) <= -1e+153:
      		tmp = 1.0 * fmin(x, y)
      	else:
      		tmp = fmax(x, y) + (b * (a - 0.5))
      	return tmp
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (Float64(Float64(Float64(fmin(x, y) + fmax(x, y)) + z) - Float64(z * log(t))) <= -1e+153)
      		tmp = Float64(1.0 * fmin(x, y));
      	else
      		tmp = Float64(fmax(x, y) + Float64(b * Float64(a - 0.5)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	tmp = 0.0;
      	if ((((min(x, y) + max(x, y)) + z) - (z * log(t))) <= -1e+153)
      		tmp = 1.0 * min(x, y);
      	else
      		tmp = max(x, y) + (b * (a - 0.5));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+153], N[(1.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      \mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -1 \cdot 10^{+153}:\\
      \;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{max}\left(x, y\right) + b \cdot \left(a - 0.5\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -1e153

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
          4. lower--.f6479.0%

            \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
        4. Applied rewrites79.0%

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

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

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

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

            \[\leadsto \left(1 - \frac{\mathsf{neg}\left(\left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\right)}{x}\right) \cdot \color{blue}{x} \]
        6. Applied rewrites63.7%

          \[\leadsto \left(1 - \frac{\left(0.5 - a\right) \cdot b - y}{x}\right) \cdot \color{blue}{x} \]
        7. Taylor expanded in x around inf

          \[\leadsto 1 \cdot x \]
        8. Step-by-step derivation
          1. Applied rewrites21.7%

            \[\leadsto 1 \cdot x \]

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

          1. Initial program 99.8%

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

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

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

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

              \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
            4. lower--.f6479.0%

              \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
          4. Applied rewrites79.0%

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

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

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

              \[\leadsto y + b \cdot \left(a - \color{blue}{\frac{1}{2}}\right) \]
            3. lower--.f6458.8%

              \[\leadsto y + b \cdot \left(a - 0.5\right) \]
          7. Applied rewrites58.8%

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

        Alternative 8: 58.7% accurate, 0.2× speedup?

        \[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+152}:\\ \;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+102}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(x, y\right) + b \cdot -0.5\\ \end{array} \]
        (FPCore (x y z t a b)
          :precision binary64
          (let* ((t_1 (+ (fmin x y) (fmax x y))))
          (if (<= t_1 -5e+152)
            (* 1.0 (fmin x y))
            (if (<= t_1 2e+102) (* b (- a 0.5)) (+ (fmax x y) (* b -0.5))))))
        double code(double x, double y, double z, double t, double a, double b) {
        	double t_1 = fmin(x, y) + fmax(x, y);
        	double tmp;
        	if (t_1 <= -5e+152) {
        		tmp = 1.0 * fmin(x, y);
        	} else if (t_1 <= 2e+102) {
        		tmp = b * (a - 0.5);
        	} else {
        		tmp = fmax(x, y) + (b * -0.5);
        	}
        	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 = fmin(x, y) + fmax(x, y)
            if (t_1 <= (-5d+152)) then
                tmp = 1.0d0 * fmin(x, y)
            else if (t_1 <= 2d+102) then
                tmp = b * (a - 0.5d0)
            else
                tmp = fmax(x, y) + (b * (-0.5d0))
            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 = fmin(x, y) + fmax(x, y);
        	double tmp;
        	if (t_1 <= -5e+152) {
        		tmp = 1.0 * fmin(x, y);
        	} else if (t_1 <= 2e+102) {
        		tmp = b * (a - 0.5);
        	} else {
        		tmp = fmax(x, y) + (b * -0.5);
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	t_1 = fmin(x, y) + fmax(x, y)
        	tmp = 0
        	if t_1 <= -5e+152:
        		tmp = 1.0 * fmin(x, y)
        	elif t_1 <= 2e+102:
        		tmp = b * (a - 0.5)
        	else:
        		tmp = fmax(x, y) + (b * -0.5)
        	return tmp
        
        function code(x, y, z, t, a, b)
        	t_1 = Float64(fmin(x, y) + fmax(x, y))
        	tmp = 0.0
        	if (t_1 <= -5e+152)
        		tmp = Float64(1.0 * fmin(x, y));
        	elseif (t_1 <= 2e+102)
        		tmp = Float64(b * Float64(a - 0.5));
        	else
        		tmp = Float64(fmax(x, y) + Float64(b * -0.5));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	t_1 = min(x, y) + max(x, y);
        	tmp = 0.0;
        	if (t_1 <= -5e+152)
        		tmp = 1.0 * min(x, y);
        	elseif (t_1 <= 2e+102)
        		tmp = b * (a - 0.5);
        	else
        		tmp = max(x, y) + (b * -0.5);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+152], N[(1.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+102], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] + N[(b * -0.5), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        t_1 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+152}:\\
        \;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\
        
        \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+102}:\\
        \;\;\;\;b \cdot \left(a - 0.5\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{max}\left(x, y\right) + b \cdot -0.5\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 x y) < -5e152

          1. Initial program 99.8%

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

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

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

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

              \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
            4. lower--.f6479.0%

              \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
          4. Applied rewrites79.0%

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

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

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

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

              \[\leadsto \left(1 - \frac{\mathsf{neg}\left(\left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\right)}{x}\right) \cdot \color{blue}{x} \]
          6. Applied rewrites63.7%

            \[\leadsto \left(1 - \frac{\left(0.5 - a\right) \cdot b - y}{x}\right) \cdot \color{blue}{x} \]
          7. Taylor expanded in x around inf

            \[\leadsto 1 \cdot x \]
          8. Step-by-step derivation
            1. Applied rewrites21.7%

              \[\leadsto 1 \cdot x \]

            if -5e152 < (+.f64 x y) < 2e102

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
              4. lower--.f6479.0%

                \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
            4. Applied rewrites79.0%

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

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

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

                \[\leadsto y + b \cdot \left(a - \color{blue}{\frac{1}{2}}\right) \]
              3. lower--.f6458.8%

                \[\leadsto y + b \cdot \left(a - 0.5\right) \]
            7. Applied rewrites58.8%

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

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

                \[\leadsto b \cdot \left(a - \frac{1}{2}\right) \]
              2. lower--.f6438.3%

                \[\leadsto b \cdot \left(a - 0.5\right) \]
            10. Applied rewrites38.3%

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

            if 2e102 < (+.f64 x y)

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
              4. lower--.f6479.0%

                \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
            4. Applied rewrites79.0%

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

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

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

                \[\leadsto y + b \cdot \left(a - \color{blue}{\frac{1}{2}}\right) \]
              3. lower--.f6458.8%

                \[\leadsto y + b \cdot \left(a - 0.5\right) \]
            7. Applied rewrites58.8%

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

              \[\leadsto y + b \cdot \frac{-1}{2} \]
            9. Step-by-step derivation
              1. Applied rewrites34.4%

                \[\leadsto y + b \cdot -0.5 \]
            10. Recombined 3 regimes into one program.
            11. Add Preprocessing

            Alternative 9: 45.3% accurate, 0.3× speedup?

            \[\begin{array}{l} \mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -1 \cdot 10^{+153}:\\ \;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \end{array} \]
            (FPCore (x y z t a b)
              :precision binary64
              (if (<= (- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t))) -1e+153)
              (* 1.0 (fmin x y))
              (* b (- a 0.5))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= -1e+153) {
            		tmp = 1.0 * fmin(x, y);
            	} else {
            		tmp = b * (a - 0.5);
            	}
            	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 ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= (-1d+153)) then
                    tmp = 1.0d0 * fmin(x, y)
                else
                    tmp = b * (a - 0.5d0)
                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 ((((fmin(x, y) + fmax(x, y)) + z) - (z * Math.log(t))) <= -1e+153) {
            		tmp = 1.0 * fmin(x, y);
            	} else {
            		tmp = b * (a - 0.5);
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if (((fmin(x, y) + fmax(x, y)) + z) - (z * math.log(t))) <= -1e+153:
            		tmp = 1.0 * fmin(x, y)
            	else:
            		tmp = b * (a - 0.5)
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if (Float64(Float64(Float64(fmin(x, y) + fmax(x, y)) + z) - Float64(z * log(t))) <= -1e+153)
            		tmp = Float64(1.0 * fmin(x, y));
            	else
            		tmp = Float64(b * Float64(a - 0.5));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if ((((min(x, y) + max(x, y)) + z) - (z * log(t))) <= -1e+153)
            		tmp = 1.0 * min(x, y);
            	else
            		tmp = b * (a - 0.5);
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+153], N[(1.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            \mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -1 \cdot 10^{+153}:\\
            \;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;b \cdot \left(a - 0.5\right)\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -1e153

              1. Initial program 99.8%

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

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

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

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

                  \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
                4. lower--.f6479.0%

                  \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
              4. Applied rewrites79.0%

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

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

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

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

                  \[\leadsto \left(1 - \frac{\mathsf{neg}\left(\left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\right)}{x}\right) \cdot \color{blue}{x} \]
              6. Applied rewrites63.7%

                \[\leadsto \left(1 - \frac{\left(0.5 - a\right) \cdot b - y}{x}\right) \cdot \color{blue}{x} \]
              7. Taylor expanded in x around inf

                \[\leadsto 1 \cdot x \]
              8. Step-by-step derivation
                1. Applied rewrites21.7%

                  \[\leadsto 1 \cdot x \]

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

                1. Initial program 99.8%

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

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

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

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

                    \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
                  4. lower--.f6479.0%

                    \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
                4. Applied rewrites79.0%

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

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

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

                    \[\leadsto y + b \cdot \left(a - \color{blue}{\frac{1}{2}}\right) \]
                  3. lower--.f6458.8%

                    \[\leadsto y + b \cdot \left(a - 0.5\right) \]
                7. Applied rewrites58.8%

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

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

                    \[\leadsto b \cdot \left(a - \frac{1}{2}\right) \]
                  2. lower--.f6438.3%

                    \[\leadsto b \cdot \left(a - 0.5\right) \]
                10. Applied rewrites38.3%

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

              Alternative 10: 21.7% accurate, 21.0× speedup?

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

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

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

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

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

                  \[\leadsto x + \left(y + b \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
                4. lower--.f6479.0%

                  \[\leadsto x + \left(y + b \cdot \left(a - \color{blue}{0.5}\right)\right) \]
              4. Applied rewrites79.0%

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

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

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

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

                  \[\leadsto \left(1 - \frac{\mathsf{neg}\left(\left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\right)}{x}\right) \cdot \color{blue}{x} \]
              6. Applied rewrites63.7%

                \[\leadsto \left(1 - \frac{\left(0.5 - a\right) \cdot b - y}{x}\right) \cdot \color{blue}{x} \]
              7. Taylor expanded in x around inf

                \[\leadsto 1 \cdot x \]
              8. Step-by-step derivation
                1. Applied rewrites21.7%

                  \[\leadsto 1 \cdot x \]
                2. Add Preprocessing

                Reproduce

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