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

Percentage Accurate: 99.8% → 99.8%
Time: 50.9s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b \]
(FPCore (x y z t a b)
  :precision binary64
  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 1/2) 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 - 1/2), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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 13 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 - \frac{1}{2}\right) \cdot b \]
(FPCore (x y z t a b)
  :precision binary64
  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 1/2) 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 - 1/2), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b

Alternative 1: 99.8% accurate, 1.0× speedup?

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;a \leq 9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128:\\
\;\;\;\;\left(\left(b \cdot \frac{-1}{2} + y\right) + x\right) - \left(\log t \cdot z - z\right)\\

\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(-1 \cdot x - z\right) - y}{t\_1}\right) \cdot t\_1\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.0000000000000001e109

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x + \left(z + a \cdot b\right)\right) - z \cdot \log t \]
    6. Step-by-step derivation
      1. lower-*.f6466.5%

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

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

    if -5.0000000000000001e109 < a < 9.2000000000000001e114

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 9.2000000000000001e114 < a

      1. Initial program 99.8%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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.8%

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

        \[\leadsto \left(1 - \frac{\left(\color{blue}{-1 \cdot x} - z\right) - y}{b \cdot \left(a - \frac{1}{2}\right)}\right) \cdot \left(b \cdot \left(a - \frac{1}{2}\right)\right) \]
      5. Step-by-step derivation
        1. lower-*.f6468.4%

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

        \[\leadsto \left(1 - \frac{\left(\color{blue}{-1 \cdot x} - z\right) - y}{b \cdot \left(a - \frac{1}{2}\right)}\right) \cdot \left(b \cdot \left(a - \frac{1}{2}\right)\right) \]
    6. Recombined 3 regimes into one program.
    7. Add Preprocessing

    Alternative 3: 90.1% accurate, 0.9× speedup?

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

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \left(z + a \cdot b\right)\right) - z \cdot \log t \]
      6. Step-by-step derivation
        1. lower-*.f6466.5%

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

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

      if -5.0000000000000001e109 < a < 9.2000000000000001e114

      1. Initial program 99.8%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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 rewrites74.9%

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

        if 9.2000000000000001e114 < a

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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.8%

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

          \[\leadsto \left(1 - \frac{\left(\color{blue}{-1 \cdot x} - z\right) - y}{b \cdot \left(a - \frac{1}{2}\right)}\right) \cdot \left(b \cdot \left(a - \frac{1}{2}\right)\right) \]
        5. Step-by-step derivation
          1. lower-*.f6468.4%

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

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

      Alternative 4: 88.4% accurate, 0.9× speedup?

      \[\begin{array}{l} t_1 := b \cdot \left(a - \frac{1}{2}\right)\\ t_2 := \left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\ \mathbf{if}\;z \leq -47999999999999997570582494259552905614254960528643683508027392:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520:\\ \;\;\;\;x + \left(y + t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (* b (- a 1/2))) (t_2 (- (+ x (+ z t_1)) (* z (log t)))))
        (if (<=
             z
             -47999999999999997570582494259552905614254960528643683508027392)
          t_2
          (if (<=
               z
               530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520)
            (+ x (+ y t_1))
            t_2))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = b * (a - 0.5);
      	double t_2 = (x + (z + t_1)) - (z * log(t));
      	double tmp;
      	if (z <= -4.8e+61) {
      		tmp = t_2;
      	} else if (z <= 5.3e+107) {
      		tmp = x + (y + t_1);
      	} else {
      		tmp = t_2;
      	}
      	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 = (x + (z + t_1)) - (z * log(t))
          if (z <= (-4.8d+61)) then
              tmp = t_2
          else if (z <= 5.3d+107) then
              tmp = x + (y + t_1)
          else
              tmp = t_2
          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 = (x + (z + t_1)) - (z * Math.log(t));
      	double tmp;
      	if (z <= -4.8e+61) {
      		tmp = t_2;
      	} else if (z <= 5.3e+107) {
      		tmp = x + (y + t_1);
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = b * (a - 0.5)
      	t_2 = (x + (z + t_1)) - (z * math.log(t))
      	tmp = 0
      	if z <= -4.8e+61:
      		tmp = t_2
      	elif z <= 5.3e+107:
      		tmp = x + (y + t_1)
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(b * Float64(a - 0.5))
      	t_2 = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t)))
      	tmp = 0.0
      	if (z <= -4.8e+61)
      		tmp = t_2;
      	elseif (z <= 5.3e+107)
      		tmp = Float64(x + Float64(y + t_1));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = b * (a - 0.5);
      	t_2 = (x + (z + t_1)) - (z * log(t));
      	tmp = 0.0;
      	if (z <= -4.8e+61)
      		tmp = t_2;
      	elseif (z <= 5.3e+107)
      		tmp = x + (y + t_1);
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -47999999999999997570582494259552905614254960528643683508027392], t$95$2, If[LessEqual[z, 530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
      
      \begin{array}{l}
      t_1 := b \cdot \left(a - \frac{1}{2}\right)\\
      t_2 := \left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\
      \mathbf{if}\;z \leq -47999999999999997570582494259552905614254960528643683508027392:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;z \leq 530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520:\\
      \;\;\;\;x + \left(y + t\_1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -4.7999999999999998e61 or 5.3000000000000003e107 < z

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        if -4.7999999999999998e61 < z < 5.3000000000000003e107

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

      Alternative 5: 88.4% accurate, 0.9× speedup?

      \[\begin{array}{l} t_1 := b \cdot \left(a - \frac{1}{2}\right)\\ t_2 := \left(a - \frac{1}{2}\right) \cdot b\\ \mathbf{if}\;t\_2 \leq -99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752:\\ \;\;\;\;x + \left(y + t\_1\right)\\ \mathbf{elif}\;t\_2 \leq 999999999999999926539781176481198923508803215199467887262646419780362305536:\\ \;\;\;\;\left(x + y\right) - \left(\log t \cdot z - z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{\left(-1 \cdot x - z\right) - y}{t\_1}\right) \cdot t\_1\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (* b (- a 1/2))) (t_2 (* (- a 1/2) b)))
        (if (<=
             t_2
             -99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752)
          (+ x (+ y t_1))
          (if (<=
               t_2
               999999999999999926539781176481198923508803215199467887262646419780362305536)
            (- (+ x y) (- (* (log t) z) z))
            (* (- 1 (/ (- (- (* -1 x) z) y) t_1)) t_1)))))
      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 <= -1e+89) {
      		tmp = x + (y + t_1);
      	} else if (t_2 <= 1e+75) {
      		tmp = (x + y) - ((log(t) * z) - z);
      	} else {
      		tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * 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) :: t_2
          real(8) :: tmp
          t_1 = b * (a - 0.5d0)
          t_2 = (a - 0.5d0) * b
          if (t_2 <= (-1d+89)) then
              tmp = x + (y + t_1)
          else if (t_2 <= 1d+75) then
              tmp = (x + y) - ((log(t) * z) - z)
          else
              tmp = (1.0d0 - (((((-1.0d0) * x) - z) - y) / t_1)) * 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 t_2 = (a - 0.5) * b;
      	double tmp;
      	if (t_2 <= -1e+89) {
      		tmp = x + (y + t_1);
      	} else if (t_2 <= 1e+75) {
      		tmp = (x + y) - ((Math.log(t) * z) - z);
      	} else {
      		tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1;
      	}
      	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 <= -1e+89:
      		tmp = x + (y + t_1)
      	elif t_2 <= 1e+75:
      		tmp = (x + y) - ((math.log(t) * z) - z)
      	else:
      		tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1
      	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 <= -1e+89)
      		tmp = Float64(x + Float64(y + t_1));
      	elseif (t_2 <= 1e+75)
      		tmp = Float64(Float64(x + y) - Float64(Float64(log(t) * z) - z));
      	else
      		tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(-1.0 * x) - z) - y) / t_1)) * t_1);
      	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 <= -1e+89)
      		tmp = x + (y + t_1);
      	elseif (t_2 <= 1e+75)
      		tmp = (x + y) - ((log(t) * z) - z);
      	else
      		tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - 1/2), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$2, -99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 999999999999999926539781176481198923508803215199467887262646419780362305536], N[(N[(x + y), $MachinePrecision] - N[(N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(1 - N[(N[(N[(N[(-1 * x), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
      
      \begin{array}{l}
      t_1 := b \cdot \left(a - \frac{1}{2}\right)\\
      t_2 := \left(a - \frac{1}{2}\right) \cdot b\\
      \mathbf{if}\;t\_2 \leq -99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752:\\
      \;\;\;\;x + \left(y + t\_1\right)\\
      
      \mathbf{elif}\;t\_2 \leq 999999999999999926539781176481198923508803215199467887262646419780362305536:\\
      \;\;\;\;\left(x + y\right) - \left(\log t \cdot z - z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(1 - \frac{\left(-1 \cdot x - z\right) - y}{t\_1}\right) \cdot t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.9999999999999999e88

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

        if -9.9999999999999999e88 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999993e74

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(x + \color{blue}{y}\right) - \left(\log t \cdot z - z\right) \]
        6. Applied rewrites62.5%

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

        if 9.9999999999999993e74 < (*.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 - \frac{1}{2}\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.8%

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

          \[\leadsto \left(1 - \frac{\left(\color{blue}{-1 \cdot x} - z\right) - y}{b \cdot \left(a - \frac{1}{2}\right)}\right) \cdot \left(b \cdot \left(a - \frac{1}{2}\right)\right) \]
        5. Step-by-step derivation
          1. lower-*.f6468.4%

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

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

      Alternative 6: 85.8% accurate, 1.0× speedup?

      \[\begin{array}{l} t_1 := \left(x + z\right) - z \cdot \log t\\ \mathbf{if}\;z \leq -270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216:\\ \;\;\;\;x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (- (+ x z) (* z (log t)))))
        (if (<=
             z
             -270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944)
          t_1
          (if (<=
               z
               250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216)
            (+ x (+ y (* b (- a 1/2))))
            t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (x + z) - (z * log(t));
      	double tmp;
      	if (z <= -2.7e+200) {
      		tmp = t_1;
      	} else if (z <= 2.5e+200) {
      		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 = (x + z) - (z * log(t))
          if (z <= (-2.7d+200)) then
              tmp = t_1
          else if (z <= 2.5d+200) 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 = (x + z) - (z * Math.log(t));
      	double tmp;
      	if (z <= -2.7e+200) {
      		tmp = t_1;
      	} else if (z <= 2.5e+200) {
      		tmp = x + (y + (b * (a - 0.5)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = (x + z) - (z * math.log(t))
      	tmp = 0
      	if z <= -2.7e+200:
      		tmp = t_1
      	elif z <= 2.5e+200:
      		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(x + z) - Float64(z * log(t)))
      	tmp = 0.0
      	if (z <= -2.7e+200)
      		tmp = t_1;
      	elseif (z <= 2.5e+200)
      		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 = (x + z) - (z * log(t));
      	tmp = 0.0;
      	if (z <= -2.7e+200)
      		tmp = t_1;
      	elseif (z <= 2.5e+200)
      		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[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944], t$95$1, If[LessEqual[z, 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216], N[(x + N[(y + N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      t_1 := \left(x + z\right) - z \cdot \log t\\
      \mathbf{if}\;z \leq -270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216:\\
      \;\;\;\;x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -2.7000000000000002e200 or 2.5000000000000001e200 < z

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(x + z\right) - \color{blue}{z} \cdot \log t \]
        6. Step-by-step derivation
          1. lower-+.f6442.1%

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

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

        if -2.7000000000000002e200 < z < 2.5000000000000001e200

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

      Alternative 7: 83.4% accurate, 1.0× speedup?

      \[\begin{array}{l} t_1 := z \cdot \left(1 - \log t\right)\\ \mathbf{if}\;z \leq -14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216:\\ \;\;\;\;x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (* z (- 1 (log t)))))
        (if (<=
             z
             -14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400)
          t_1
          (if (<=
               z
               250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216)
            (+ x (+ y (* b (- a 1/2))))
            t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = z * (1.0 - log(t));
      	double tmp;
      	if (z <= -1.48e+268) {
      		tmp = t_1;
      	} else if (z <= 2.5e+200) {
      		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))
          if (z <= (-1.48d+268)) then
              tmp = t_1
          else if (z <= 2.5d+200) 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));
      	double tmp;
      	if (z <= -1.48e+268) {
      		tmp = t_1;
      	} else if (z <= 2.5e+200) {
      		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))
      	tmp = 0
      	if z <= -1.48e+268:
      		tmp = t_1
      	elif z <= 2.5e+200:
      		tmp = x + (y + (b * (a - 0.5)))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(z * Float64(1.0 - log(t)))
      	tmp = 0.0
      	if (z <= -1.48e+268)
      		tmp = t_1;
      	elseif (z <= 2.5e+200)
      		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));
      	tmp = 0.0;
      	if (z <= -1.48e+268)
      		tmp = t_1;
      	elseif (z <= 2.5e+200)
      		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[(z * N[(1 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400], t$95$1, If[LessEqual[z, 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216], N[(x + N[(y + N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      t_1 := z \cdot \left(1 - \log t\right)\\
      \mathbf{if}\;z \leq -14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216:\\
      \;\;\;\;x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.48e268 or 2.5000000000000001e200 < z

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.48e268 < z < 2.5000000000000001e200

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

      Alternative 8: 78.6% accurate, 8.4× speedup?

      \[x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right) \]
      (FPCore (x y z t a b)
        :precision binary64
        (+ x (+ y (* b (- a 1/2)))))
      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 - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)
      
      Derivation
      1. Initial program 99.8%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

      Alternative 9: 78.0% accurate, 0.3× speedup?

      \[\begin{array}{l} t_1 := b \cdot \left(a - \frac{1}{2}\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 \frac{-2206260905240795}{44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608}:\\ \;\;\;\;\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 1/2))))
        (if (<=
             (- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t)))
             -2206260905240795/44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608)
          (+ (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-203) {
      		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-203)) 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-203) {
      		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-203:
      		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-203)
      		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-203)
      		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 - 1/2), $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], -2206260905240795/44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608], 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 - \frac{1}{2}\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 \frac{-2206260905240795}{44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608}:\\
      \;\;\;\;\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))) < -5.0000000000000002e-203

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

          \[\leadsto x + \left(y + a \cdot \color{blue}{b}\right) \]
        6. Step-by-step derivation
          1. lower-*.f6466.1%

            \[\leadsto x + \left(y + a \cdot b\right) \]
        7. Applied rewrites66.1%

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

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

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

            \[\leadsto x + b \cdot \left(a - \frac{1}{2}\right) \]
        10. Applied rewrites58.3%

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

        if -5.0000000000000002e-203 < (-.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 - \frac{1}{2}\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--.f6478.6%

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

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

          \[\leadsto x + \left(y + a \cdot \color{blue}{b}\right) \]
        6. Step-by-step derivation
          1. lower-*.f6466.1%

            \[\leadsto x + \left(y + a \cdot b\right) \]
        7. Applied rewrites66.1%

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

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

            \[\leadsto y + b \cdot \left(a - \frac{1}{2}\right) \]
        10. Applied rewrites58.2%

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

      Alternative 10: 69.1% accurate, 0.5× speedup?

      \[\begin{array}{l} t_1 := \left(a - \frac{1}{2}\right) \cdot b\\ t_2 := \mathsf{max}\left(x, y\right) + b \cdot \left(a - \frac{1}{2}\right)\\ \mathbf{if}\;t\_1 \leq -10000000000000000146306952306748730309700429878646550592786107871697963642511482159104:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 50000000000000004410680702653211320350932992:\\ \;\;\;\;\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
      (FPCore (x y z t a b)
        :precision binary64
        (let* ((t_1 (* (- a 1/2) b)) (t_2 (+ (fmax x y) (* b (- a 1/2)))))
        (if (<=
             t_1
             -10000000000000000146306952306748730309700429878646550592786107871697963642511482159104)
          t_2
          (if (<= t_1 50000000000000004410680702653211320350932992)
            (+ (fmin x y) (fmax x y))
            t_2))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (a - 0.5) * b;
      	double t_2 = fmax(x, y) + (b * (a - 0.5));
      	double tmp;
      	if (t_1 <= -1e+85) {
      		tmp = t_2;
      	} else if (t_1 <= 5e+43) {
      		tmp = fmin(x, y) + fmax(x, y);
      	} else {
      		tmp = t_2;
      	}
      	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 = (a - 0.5d0) * b
          t_2 = fmax(x, y) + (b * (a - 0.5d0))
          if (t_1 <= (-1d+85)) then
              tmp = t_2
          else if (t_1 <= 5d+43) then
              tmp = fmin(x, y) + fmax(x, y)
          else
              tmp = t_2
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (a - 0.5) * b;
      	double t_2 = fmax(x, y) + (b * (a - 0.5));
      	double tmp;
      	if (t_1 <= -1e+85) {
      		tmp = t_2;
      	} else if (t_1 <= 5e+43) {
      		tmp = fmin(x, y) + fmax(x, y);
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = (a - 0.5) * b
      	t_2 = fmax(x, y) + (b * (a - 0.5))
      	tmp = 0
      	if t_1 <= -1e+85:
      		tmp = t_2
      	elif t_1 <= 5e+43:
      		tmp = fmin(x, y) + fmax(x, y)
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(Float64(a - 0.5) * b)
      	t_2 = Float64(fmax(x, y) + Float64(b * Float64(a - 0.5)))
      	tmp = 0.0
      	if (t_1 <= -1e+85)
      		tmp = t_2;
      	elseif (t_1 <= 5e+43)
      		tmp = Float64(fmin(x, y) + fmax(x, y));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = (a - 0.5) * b;
      	t_2 = max(x, y) + (b * (a - 0.5));
      	tmp = 0.0;
      	if (t_1 <= -1e+85)
      		tmp = t_2;
      	elseif (t_1 <= 5e+43)
      		tmp = min(x, y) + max(x, y);
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 1/2), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[Max[x, y], $MachinePrecision] + N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10000000000000000146306952306748730309700429878646550592786107871697963642511482159104], t$95$2, If[LessEqual[t$95$1, 50000000000000004410680702653211320350932992], N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
      
      \begin{array}{l}
      t_1 := \left(a - \frac{1}{2}\right) \cdot b\\
      t_2 := \mathsf{max}\left(x, y\right) + b \cdot \left(a - \frac{1}{2}\right)\\
      \mathbf{if}\;t\_1 \leq -10000000000000000146306952306748730309700429878646550592786107871697963642511482159104:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq 50000000000000004410680702653211320350932992:\\
      \;\;\;\;\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e85 or 5.0000000000000004e43 < (*.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 - \frac{1}{2}\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--.f6478.6%

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

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

          \[\leadsto x + \left(y + a \cdot \color{blue}{b}\right) \]
        6. Step-by-step derivation
          1. lower-*.f6466.1%

            \[\leadsto x + \left(y + a \cdot b\right) \]
        7. Applied rewrites66.1%

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

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

            \[\leadsto y + b \cdot \left(a - \frac{1}{2}\right) \]
        10. Applied rewrites58.2%

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

        if -1e85 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.0000000000000004e43

        1. Initial program 99.8%

          \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

          \[\leadsto x + \left(y + a \cdot \color{blue}{b}\right) \]
        6. Step-by-step derivation
          1. lower-*.f6466.1%

            \[\leadsto x + \left(y + a \cdot b\right) \]
        7. Applied rewrites66.1%

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

          \[\leadsto x + \color{blue}{y} \]
        9. Step-by-step derivation
          1. lower-+.f6441.8%

            \[\leadsto x + y \]
        10. Applied rewrites41.8%

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

      Alternative 11: 41.8% accurate, 31.5× speedup?

      \[x + y \]
      (FPCore (x y z t a b)
        :precision binary64
        (+ x y))
      double code(double x, double y, double z, double t, double a, double b) {
      	return x + y;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b)
      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
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	return x + y;
      }
      
      def code(x, y, z, t, a, b):
      	return x + y
      
      function code(x, y, z, t, a, b)
      	return Float64(x + y)
      end
      
      function tmp = code(x, y, z, t, a, b)
      	tmp = x + y;
      end
      
      code[x_, y_, z_, t_, a_, b_] := N[(x + y), $MachinePrecision]
      
      x + y
      
      Derivation
      1. Initial program 99.8%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

        \[\leadsto x + \left(y + a \cdot \color{blue}{b}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6466.1%

          \[\leadsto x + \left(y + a \cdot b\right) \]
      7. Applied rewrites66.1%

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

        \[\leadsto x + \color{blue}{y} \]
      9. Step-by-step derivation
        1. lower-+.f6441.8%

          \[\leadsto x + y \]
      10. Applied rewrites41.8%

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

      Alternative 12: 21.1% accurate, 1.2× speedup?

      \[\mathsf{max}\left(x, y\right) \]
      (FPCore (x y z t a b)
        :precision binary64
        (fmax x y))
      double code(double x, double y, double z, double t, double a, double b) {
      	return fmax(x, y);
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b)
      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 = fmax(x, y)
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	return fmax(x, y);
      }
      
      def code(x, y, z, t, a, b):
      	return fmax(x, y)
      
      function code(x, y, z, t, a, b)
      	return fmax(x, y)
      end
      
      function tmp = code(x, y, z, t, a, b)
      	tmp = max(x, y);
      end
      
      code[x_, y_, z_, t_, a_, b_] := N[Max[x, y], $MachinePrecision]
      
      \mathsf{max}\left(x, y\right)
      
      Derivation
      1. Initial program 99.8%

        \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\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--.f6478.6%

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

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

        \[\leadsto x + \left(y + a \cdot \color{blue}{b}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6466.1%

          \[\leadsto x + \left(y + a \cdot b\right) \]
      7. Applied rewrites66.1%

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

        \[\leadsto x + \color{blue}{y} \]
      9. Step-by-step derivation
        1. lower-+.f6441.8%

          \[\leadsto x + y \]
      10. Applied rewrites41.8%

        \[\leadsto x + \color{blue}{y} \]
      11. Taylor expanded in x around 0

        \[\leadsto y \]
      12. Step-by-step derivation
        1. Applied rewrites21.8%

          \[\leadsto y \]
        2. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025271 -o generate:evaluate
        (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 1/2) b)))