Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C

Percentage Accurate: 97.5% → 97.6%
Time: 9.1s
Alternatives: 9
Speedup: 1.3×

Specification

?
\[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
(FPCore (x y z t a b c)
  :precision binary64
  (+ (- (+ (* x y) (/ (* z t) 16)) (/ (* a b) 4)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
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, c)
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), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c

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 9 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: 97.5% accurate, 1.0× speedup?

\[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
(FPCore (x y z t a b c)
  :precision binary64
  (+ (- (+ (* x y) (/ (* z t) 16)) (/ (* a b) 4)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
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, c)
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), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c

Alternative 1: 97.6% accurate, 1.3× speedup?

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

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left(\left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. mult-flipN/A

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

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

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

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

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

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

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

      \[\leadsto \left(\left(x \cdot y + \color{blue}{\left(\frac{1}{16} \cdot z\right)} \cdot t\right) - \frac{a \cdot b}{4}\right) + c \]
    10. metadata-eval97.6%

      \[\leadsto \left(\left(x \cdot y + \left(\color{blue}{\frac{1}{16}} \cdot z\right) \cdot t\right) - \frac{a \cdot b}{4}\right) + c \]
  3. Applied rewrites97.6%

    \[\leadsto \left(\left(x \cdot y + \color{blue}{\left(\frac{1}{16} \cdot z\right) \cdot t}\right) - \frac{a \cdot b}{4}\right) + c \]
  4. Step-by-step derivation
    1. lift-/.f64N/A

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

      \[\leadsto \left(\left(x \cdot y + \left(\frac{1}{16} \cdot z\right) \cdot t\right) - \color{blue}{\left(a \cdot b\right) \cdot \frac{1}{4}}\right) + c \]
    3. metadata-evalN/A

      \[\leadsto \left(\left(x \cdot y + \left(\frac{1}{16} \cdot z\right) \cdot t\right) - \left(a \cdot b\right) \cdot \color{blue}{\frac{1}{4}}\right) + c \]
    4. lower-*.f6497.6%

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

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

      \[\leadsto \left(\left(x \cdot y + \left(\frac{1}{16} \cdot z\right) \cdot t\right) - \color{blue}{\left(b \cdot a\right)} \cdot \frac{1}{4}\right) + c \]
    7. lower-*.f6497.6%

      \[\leadsto \left(\left(x \cdot y + \left(\frac{1}{16} \cdot z\right) \cdot t\right) - \color{blue}{\left(b \cdot a\right)} \cdot \frac{1}{4}\right) + c \]
  5. Applied rewrites97.6%

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

Alternative 2: 88.9% accurate, 1.0× speedup?

\[\begin{array}{l} t_1 := \frac{1}{4} \cdot \left(a \cdot b\right)\\ \mathbf{if}\;x \cdot y \leq -500000000000000022442856339037958392774656:\\ \;\;\;\;\left(x \cdot y - t\_1\right) + c\\ \mathbf{elif}\;x \cdot y \leq 40000000000000001313662499568197043159480502654384467820492537050349880275951519821760052625109096507357980191372897423145939625368459673600:\\ \;\;\;\;\left(\frac{1}{16} \cdot \left(t \cdot z\right) - t\_1\right) + c\\ \mathbf{else}:\\ \;\;\;\;c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right)\\ \end{array} \]
(FPCore (x y z t a b c)
  :precision binary64
  (let* ((t_1 (* 1/4 (* a b))))
  (if (<= (* x y) -500000000000000022442856339037958392774656)
    (+ (- (* x y) t_1) c)
    (if (<=
         (* x y)
         40000000000000001313662499568197043159480502654384467820492537050349880275951519821760052625109096507357980191372897423145939625368459673600)
      (+ (- (* 1/16 (* t z)) t_1) c)
      (+ c (+ (* (* z 1/16) t) (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.25 * (a * b);
	double tmp;
	if ((x * y) <= -5e+41) {
		tmp = ((x * y) - t_1) + c;
	} else if ((x * y) <= 4e+139) {
		tmp = ((0.0625 * (t * z)) - t_1) + c;
	} else {
		tmp = c + (((z * 0.0625) * t) + (x * y));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 0.25d0 * (a * b)
    if ((x * y) <= (-5d+41)) then
        tmp = ((x * y) - t_1) + c
    else if ((x * y) <= 4d+139) then
        tmp = ((0.0625d0 * (t * z)) - t_1) + c
    else
        tmp = c + (((z * 0.0625d0) * t) + (x * y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.25 * (a * b);
	double tmp;
	if ((x * y) <= -5e+41) {
		tmp = ((x * y) - t_1) + c;
	} else if ((x * y) <= 4e+139) {
		tmp = ((0.0625 * (t * z)) - t_1) + c;
	} else {
		tmp = c + (((z * 0.0625) * t) + (x * y));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.25 * (a * b)
	tmp = 0
	if (x * y) <= -5e+41:
		tmp = ((x * y) - t_1) + c
	elif (x * y) <= 4e+139:
		tmp = ((0.0625 * (t * z)) - t_1) + c
	else:
		tmp = c + (((z * 0.0625) * t) + (x * y))
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.25 * Float64(a * b))
	tmp = 0.0
	if (Float64(x * y) <= -5e+41)
		tmp = Float64(Float64(Float64(x * y) - t_1) + c);
	elseif (Float64(x * y) <= 4e+139)
		tmp = Float64(Float64(Float64(0.0625 * Float64(t * z)) - t_1) + c);
	else
		tmp = Float64(c + Float64(Float64(Float64(z * 0.0625) * t) + Float64(x * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.25 * (a * b);
	tmp = 0.0;
	if ((x * y) <= -5e+41)
		tmp = ((x * y) - t_1) + c;
	elseif ((x * y) <= 4e+139)
		tmp = ((0.0625 * (t * z)) - t_1) + c;
	else
		tmp = c + (((z * 0.0625) * t) + (x * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1/4 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -500000000000000022442856339037958392774656], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] + c), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 40000000000000001313662499568197043159480502654384467820492537050349880275951519821760052625109096507357980191372897423145939625368459673600], N[(N[(N[(1/16 * N[(t * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + c), $MachinePrecision], N[(c + N[(N[(N[(z * 1/16), $MachinePrecision] * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{1}{4} \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \cdot y \leq -500000000000000022442856339037958392774656:\\
\;\;\;\;\left(x \cdot y - t\_1\right) + c\\

\mathbf{elif}\;x \cdot y \leq 40000000000000001313662499568197043159480502654384467820492537050349880275951519821760052625109096507357980191372897423145939625368459673600:\\
\;\;\;\;\left(\frac{1}{16} \cdot \left(t \cdot z\right) - t\_1\right) + c\\

\mathbf{else}:\\
\;\;\;\;c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.0000000000000002e41

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto \left(x \cdot y - \frac{1}{4} \cdot \color{blue}{\left(a \cdot b\right)}\right) + c \]
      4. lower-*.f6473.6%

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

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

    if -5.0000000000000002e41 < (*.f64 x y) < 4.0000000000000001e139

    1. Initial program 97.5%

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

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

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

        \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) - \color{blue}{\frac{1}{4}} \cdot \left(a \cdot b\right)\right) + c \]
      3. lower-*.f64N/A

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

        \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) - \frac{1}{4} \cdot \color{blue}{\left(a \cdot b\right)}\right) + c \]
      5. lower-*.f6473.4%

        \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) - \frac{1}{4} \cdot \left(a \cdot \color{blue}{b}\right)\right) + c \]
    4. Applied rewrites73.4%

      \[\leadsto \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right) - \frac{1}{4} \cdot \left(a \cdot b\right)\right)} + c \]

    if 4.0000000000000001e139 < (*.f64 x y)

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(z \cdot t\right) + x \cdot y\right) \]
      4. associate-*l*N/A

        \[\leadsto c + \left(\left(\frac{1}{16} \cdot z\right) \cdot t + \color{blue}{x} \cdot y\right) \]
      5. lower-*.f64N/A

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

        \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right) \]
      7. lower-*.f6473.8%

        \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right) \]
    6. Applied rewrites73.8%

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

Alternative 3: 87.1% accurate, 0.7× speedup?

\[\begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ \mathbf{if}\;t\_1 \leq -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728:\\ \;\;\;\;\left(-\frac{1}{4} \cdot a\right) \cdot b\\ \mathbf{elif}\;t\_1 \leq 100000000000000009190283508143378238084034459715684532224:\\ \;\;\;\;c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - \frac{1}{4} \cdot \left(a \cdot b\right)\right) + c\\ \end{array} \]
(FPCore (x y z t a b c)
  :precision binary64
  (let* ((t_1 (/ (* a b) 4)))
  (if (<=
       t_1
       -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728)
    (* (- (* 1/4 a)) b)
    (if (<=
         t_1
         100000000000000009190283508143378238084034459715684532224)
      (+ c (+ (* (* z 1/16) t) (* x y)))
      (+ (- (* x y) (* 1/4 (* a b))) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double tmp;
	if (t_1 <= -5e+276) {
		tmp = -(0.25 * a) * b;
	} else if (t_1 <= 1e+56) {
		tmp = c + (((z * 0.0625) * t) + (x * y));
	} else {
		tmp = ((x * y) - (0.25 * (a * b))) + c;
	}
	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, c)
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), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) / 4.0d0
    if (t_1 <= (-5d+276)) then
        tmp = -(0.25d0 * a) * b
    else if (t_1 <= 1d+56) then
        tmp = c + (((z * 0.0625d0) * t) + (x * y))
    else
        tmp = ((x * y) - (0.25d0 * (a * b))) + c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double tmp;
	if (t_1 <= -5e+276) {
		tmp = -(0.25 * a) * b;
	} else if (t_1 <= 1e+56) {
		tmp = c + (((z * 0.0625) * t) + (x * y));
	} else {
		tmp = ((x * y) - (0.25 * (a * b))) + c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) / 4.0
	tmp = 0
	if t_1 <= -5e+276:
		tmp = -(0.25 * a) * b
	elif t_1 <= 1e+56:
		tmp = c + (((z * 0.0625) * t) + (x * y))
	else:
		tmp = ((x * y) - (0.25 * (a * b))) + c
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) / 4.0)
	tmp = 0.0
	if (t_1 <= -5e+276)
		tmp = Float64(Float64(-Float64(0.25 * a)) * b);
	elseif (t_1 <= 1e+56)
		tmp = Float64(c + Float64(Float64(Float64(z * 0.0625) * t) + Float64(x * y)));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(0.25 * Float64(a * b))) + c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) / 4.0;
	tmp = 0.0;
	if (t_1 <= -5e+276)
		tmp = -(0.25 * a) * b;
	elseif (t_1 <= 1e+56)
		tmp = c + (((z * 0.0625) * t) + (x * y));
	else
		tmp = ((x * y) - (0.25 * (a * b))) + c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4), $MachinePrecision]}, If[LessEqual[t$95$1, -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728], N[((-N[(1/4 * a), $MachinePrecision]) * b), $MachinePrecision], If[LessEqual[t$95$1, 100000000000000009190283508143378238084034459715684532224], N[(c + N[(N[(N[(z * 1/16), $MachinePrecision] * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(1/4 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728:\\
\;\;\;\;\left(-\frac{1}{4} \cdot a\right) \cdot b\\

\mathbf{elif}\;t\_1 \leq 100000000000000009190283508143378238084034459715684532224:\\
\;\;\;\;c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right)\\

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


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

    1. Initial program 97.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in b around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot a\right)\right) \]
      11. lower-*.f6481.3%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites81.3%

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
    7. Applied rewrites28.5%

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

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

        \[\leadsto \mathsf{neg}\left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{4} \cdot a\right) \cdot b\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{4} \cdot a\right)\right) \cdot \color{blue}{b} \]
      7. lower-neg.f6428.5%

        \[\leadsto \left(-\frac{1}{4} \cdot a\right) \cdot b \]
    9. Applied rewrites28.5%

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

    if -5e276 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 1.0000000000000001e56

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(z \cdot t\right) + x \cdot y\right) \]
      4. associate-*l*N/A

        \[\leadsto c + \left(\left(\frac{1}{16} \cdot z\right) \cdot t + \color{blue}{x} \cdot y\right) \]
      5. lower-*.f64N/A

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

        \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right) \]
      7. lower-*.f6473.8%

        \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right) \]
    6. Applied rewrites73.8%

      \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + \color{blue}{x} \cdot y\right) \]

    if 1.0000000000000001e56 < (/.f64 (*.f64 a b) #s(literal 4 binary64))

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto \left(x \cdot y - \frac{1}{4} \cdot \color{blue}{\left(a \cdot b\right)}\right) + c \]
      4. lower-*.f6473.6%

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

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

Alternative 4: 85.6% accurate, 0.7× speedup?

\[\begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ \mathbf{if}\;t\_1 \leq -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728:\\ \;\;\;\;\left(-\frac{1}{4} \cdot a\right) \cdot b\\ \mathbf{elif}\;t\_1 \leq 100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552:\\ \;\;\;\;c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{4} \cdot \left(a \cdot b\right) + c\\ \end{array} \]
(FPCore (x y z t a b c)
  :precision binary64
  (let* ((t_1 (/ (* a b) 4)))
  (if (<=
       t_1
       -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728)
    (* (- (* 1/4 a)) b)
    (if (<=
         t_1
         100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552)
      (+ c (+ (* (* z 1/16) t) (* x y)))
      (+ (* -1/4 (* a b)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double tmp;
	if (t_1 <= -5e+276) {
		tmp = -(0.25 * a) * b;
	} else if (t_1 <= 1e+206) {
		tmp = c + (((z * 0.0625) * t) + (x * y));
	} else {
		tmp = (-0.25 * (a * b)) + c;
	}
	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, c)
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), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) / 4.0d0
    if (t_1 <= (-5d+276)) then
        tmp = -(0.25d0 * a) * b
    else if (t_1 <= 1d+206) then
        tmp = c + (((z * 0.0625d0) * t) + (x * y))
    else
        tmp = ((-0.25d0) * (a * b)) + c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double tmp;
	if (t_1 <= -5e+276) {
		tmp = -(0.25 * a) * b;
	} else if (t_1 <= 1e+206) {
		tmp = c + (((z * 0.0625) * t) + (x * y));
	} else {
		tmp = (-0.25 * (a * b)) + c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) / 4.0
	tmp = 0
	if t_1 <= -5e+276:
		tmp = -(0.25 * a) * b
	elif t_1 <= 1e+206:
		tmp = c + (((z * 0.0625) * t) + (x * y))
	else:
		tmp = (-0.25 * (a * b)) + c
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) / 4.0)
	tmp = 0.0
	if (t_1 <= -5e+276)
		tmp = Float64(Float64(-Float64(0.25 * a)) * b);
	elseif (t_1 <= 1e+206)
		tmp = Float64(c + Float64(Float64(Float64(z * 0.0625) * t) + Float64(x * y)));
	else
		tmp = Float64(Float64(-0.25 * Float64(a * b)) + c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) / 4.0;
	tmp = 0.0;
	if (t_1 <= -5e+276)
		tmp = -(0.25 * a) * b;
	elseif (t_1 <= 1e+206)
		tmp = c + (((z * 0.0625) * t) + (x * y));
	else
		tmp = (-0.25 * (a * b)) + c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4), $MachinePrecision]}, If[LessEqual[t$95$1, -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728], N[((-N[(1/4 * a), $MachinePrecision]) * b), $MachinePrecision], If[LessEqual[t$95$1, 100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552], N[(c + N[(N[(N[(z * 1/16), $MachinePrecision] * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1/4 * N[(a * b), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728:\\
\;\;\;\;\left(-\frac{1}{4} \cdot a\right) \cdot b\\

\mathbf{elif}\;t\_1 \leq 100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552:\\
\;\;\;\;c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{4} \cdot \left(a \cdot b\right) + c\\


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

    1. Initial program 97.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in b around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot a\right)\right) \]
      11. lower-*.f6481.3%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites81.3%

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
    7. Applied rewrites28.5%

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

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

        \[\leadsto \mathsf{neg}\left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{4} \cdot a\right) \cdot b\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{4} \cdot a\right)\right) \cdot \color{blue}{b} \]
      7. lower-neg.f6428.5%

        \[\leadsto \left(-\frac{1}{4} \cdot a\right) \cdot b \]
    9. Applied rewrites28.5%

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

    if -5e276 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 1e206

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(z \cdot t\right) + x \cdot y\right) \]
      4. associate-*l*N/A

        \[\leadsto c + \left(\left(\frac{1}{16} \cdot z\right) \cdot t + \color{blue}{x} \cdot y\right) \]
      5. lower-*.f64N/A

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

        \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right) \]
      7. lower-*.f6473.8%

        \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + x \cdot y\right) \]
    6. Applied rewrites73.8%

      \[\leadsto c + \left(\left(z \cdot \frac{1}{16}\right) \cdot t + \color{blue}{x} \cdot y\right) \]

    if 1e206 < (/.f64 (*.f64 a b) #s(literal 4 binary64))

    1. Initial program 97.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in a around inf

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

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

        \[\leadsto \frac{-1}{4} \cdot \left(a \cdot \color{blue}{b}\right) + c \]
    4. Applied rewrites48.3%

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

Alternative 5: 85.5% accurate, 0.7× speedup?

\[\begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ \mathbf{if}\;t\_1 \leq -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728:\\ \;\;\;\;\left(-\frac{1}{4} \cdot a\right) \cdot b\\ \mathbf{elif}\;t\_1 \leq 100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552:\\ \;\;\;\;c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{4} \cdot \left(a \cdot b\right) + c\\ \end{array} \]
(FPCore (x y z t a b c)
  :precision binary64
  (let* ((t_1 (/ (* a b) 4)))
  (if (<=
       t_1
       -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728)
    (* (- (* 1/4 a)) b)
    (if (<=
         t_1
         100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552)
      (+ c (+ (* 1/16 (* t z)) (* x y)))
      (+ (* -1/4 (* a b)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double tmp;
	if (t_1 <= -5e+276) {
		tmp = -(0.25 * a) * b;
	} else if (t_1 <= 1e+206) {
		tmp = c + ((0.0625 * (t * z)) + (x * y));
	} else {
		tmp = (-0.25 * (a * b)) + c;
	}
	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, c)
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), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) / 4.0d0
    if (t_1 <= (-5d+276)) then
        tmp = -(0.25d0 * a) * b
    else if (t_1 <= 1d+206) then
        tmp = c + ((0.0625d0 * (t * z)) + (x * y))
    else
        tmp = ((-0.25d0) * (a * b)) + c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double tmp;
	if (t_1 <= -5e+276) {
		tmp = -(0.25 * a) * b;
	} else if (t_1 <= 1e+206) {
		tmp = c + ((0.0625 * (t * z)) + (x * y));
	} else {
		tmp = (-0.25 * (a * b)) + c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) / 4.0
	tmp = 0
	if t_1 <= -5e+276:
		tmp = -(0.25 * a) * b
	elif t_1 <= 1e+206:
		tmp = c + ((0.0625 * (t * z)) + (x * y))
	else:
		tmp = (-0.25 * (a * b)) + c
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) / 4.0)
	tmp = 0.0
	if (t_1 <= -5e+276)
		tmp = Float64(Float64(-Float64(0.25 * a)) * b);
	elseif (t_1 <= 1e+206)
		tmp = Float64(c + Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y)));
	else
		tmp = Float64(Float64(-0.25 * Float64(a * b)) + c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) / 4.0;
	tmp = 0.0;
	if (t_1 <= -5e+276)
		tmp = -(0.25 * a) * b;
	elseif (t_1 <= 1e+206)
		tmp = c + ((0.0625 * (t * z)) + (x * y));
	else
		tmp = (-0.25 * (a * b)) + c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4), $MachinePrecision]}, If[LessEqual[t$95$1, -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728], N[((-N[(1/4 * a), $MachinePrecision]) * b), $MachinePrecision], If[LessEqual[t$95$1, 100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552], N[(c + N[(N[(1/16 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1/4 * N[(a * b), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq -5000000000000000014339392554976861624351030032307491891786714963455192826951136079841645978666612324808479156564299152005093968192740890223899883592402933027172967020052041660293849107704861024718326980908701245637596009600853559934996040535864898581843704726957456644770889728:\\
\;\;\;\;\left(-\frac{1}{4} \cdot a\right) \cdot b\\

\mathbf{elif}\;t\_1 \leq 100000000000000003889357755108838843130737249295202013334302382007691294289384896763079965607877701387326460311941213291353170611409437561654018367221268940354434586262616943544566455807655946219322240663552:\\
\;\;\;\;c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{4} \cdot \left(a \cdot b\right) + c\\


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

    1. Initial program 97.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in b around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot a\right)\right) \]
      11. lower-*.f6481.3%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites81.3%

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
    7. Applied rewrites28.5%

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

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

        \[\leadsto \mathsf{neg}\left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(\frac{1}{4} \cdot a\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{4} \cdot a\right) \cdot b\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{4} \cdot a\right)\right) \cdot \color{blue}{b} \]
      7. lower-neg.f6428.5%

        \[\leadsto \left(-\frac{1}{4} \cdot a\right) \cdot b \]
    9. Applied rewrites28.5%

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

    if -5e276 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 1e206

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]

    if 1e206 < (/.f64 (*.f64 a b) #s(literal 4 binary64))

    1. Initial program 97.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in a around inf

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

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

        \[\leadsto \frac{-1}{4} \cdot \left(a \cdot \color{blue}{b}\right) + c \]
    4. Applied rewrites48.3%

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

Alternative 6: 65.1% accurate, 1.3× speedup?

\[\begin{array}{l} t_1 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -500000000000000022442856339037958392774656:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 50000000000000003758724345825910431373571453217620410674145455117888296262120760233227055054887901771413297751942626316333875200:\\ \;\;\;\;c + \frac{1}{16} \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c)
  :precision binary64
  (let* ((t_1 (+ c (* x y))))
  (if (<= (* x y) -500000000000000022442856339037958392774656)
    t_1
    (if (<=
         (* x y)
         50000000000000003758724345825910431373571453217620410674145455117888296262120760233227055054887901771413297751942626316333875200)
      (+ c (* 1/16 (* t z)))
      t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double tmp;
	if ((x * y) <= -5e+41) {
		tmp = t_1;
	} else if ((x * y) <= 5e+127) {
		tmp = c + (0.0625 * (t * z));
	} 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, c)
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), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = c + (x * y)
    if ((x * y) <= (-5d+41)) then
        tmp = t_1
    else if ((x * y) <= 5d+127) then
        tmp = c + (0.0625d0 * (t * z))
    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 c) {
	double t_1 = c + (x * y);
	double tmp;
	if ((x * y) <= -5e+41) {
		tmp = t_1;
	} else if ((x * y) <= 5e+127) {
		tmp = c + (0.0625 * (t * z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	tmp = 0
	if (x * y) <= -5e+41:
		tmp = t_1
	elif (x * y) <= 5e+127:
		tmp = c + (0.0625 * (t * z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -5e+41)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e+127)
		tmp = Float64(c + Float64(0.0625 * Float64(t * z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -5e+41)
		tmp = t_1;
	elseif ((x * y) <= 5e+127)
		tmp = c + (0.0625 * (t * z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -500000000000000022442856339037958392774656], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 50000000000000003758724345825910431373571453217620410674145455117888296262120760233227055054887901771413297751942626316333875200], N[(c + N[(1/16 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -500000000000000022442856339037958392774656:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 50000000000000003758724345825910431373571453217620410674145455117888296262120760233227055054887901771413297751942626316333875200:\\
\;\;\;\;c + \frac{1}{16} \cdot \left(t \cdot z\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -5.0000000000000002e41 or 5.0000000000000004e127 < (*.f64 x y)

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto c + \color{blue}{x \cdot y} \]
    6. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto c + x \cdot \color{blue}{y} \]
      2. lower-*.f6448.6%

        \[\leadsto c + x \cdot y \]
    7. Applied rewrites48.6%

      \[\leadsto c + \color{blue}{x \cdot y} \]

    if -5.0000000000000002e41 < (*.f64 x y) < 5.0000000000000004e127

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    5. Taylor expanded in x around 0

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

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

        \[\leadsto c + \frac{1}{16} \cdot \left(t \cdot \color{blue}{z}\right) \]
      3. lower-*.f6448.4%

        \[\leadsto c + \frac{1}{16} \cdot \left(t \cdot z\right) \]
    7. Applied rewrites48.4%

      \[\leadsto c + \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 63.0% accurate, 0.8× speedup?

\[\begin{array}{l} t_1 := \frac{z \cdot t}{16}\\ t_2 := -\frac{-1}{16} \cdot \left(t \cdot z\right)\\ \mathbf{if}\;t\_1 \leq -499999999999999976986103364828435105866493856869550354915370776598145356642472906604169238853083206186863000925026831505293584046586944536955141361661791768572429254787072:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 1000000000000000068957567536844582937679826098352437099093782830596656320642208754566186799616905285426599982929417458880300383900478261195703581718577367397759832385751351296:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a b c)
  :precision binary64
  (let* ((t_1 (/ (* z t) 16)) (t_2 (- (* -1/16 (* t z)))))
  (if (<=
       t_1
       -499999999999999976986103364828435105866493856869550354915370776598145356642472906604169238853083206186863000925026831505293584046586944536955141361661791768572429254787072)
    t_2
    (if (<=
         t_1
         1000000000000000068957567536844582937679826098352437099093782830596656320642208754566186799616905285426599982929417458880300383900478261195703581718577367397759832385751351296)
      (+ c (* x y))
      t_2))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (z * t) / 16.0;
	double t_2 = -(-0.0625 * (t * z));
	double tmp;
	if (t_1 <= -5e+170) {
		tmp = t_2;
	} else if (t_1 <= 1e+174) {
		tmp = c + (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, c)
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), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z * t) / 16.0d0
    t_2 = -((-0.0625d0) * (t * z))
    if (t_1 <= (-5d+170)) then
        tmp = t_2
    else if (t_1 <= 1d+174) then
        tmp = c + (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 c) {
	double t_1 = (z * t) / 16.0;
	double t_2 = -(-0.0625 * (t * z));
	double tmp;
	if (t_1 <= -5e+170) {
		tmp = t_2;
	} else if (t_1 <= 1e+174) {
		tmp = c + (x * y);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (z * t) / 16.0
	t_2 = -(-0.0625 * (t * z))
	tmp = 0
	if t_1 <= -5e+170:
		tmp = t_2
	elif t_1 <= 1e+174:
		tmp = c + (x * y)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(z * t) / 16.0)
	t_2 = Float64(-Float64(-0.0625 * Float64(t * z)))
	tmp = 0.0
	if (t_1 <= -5e+170)
		tmp = t_2;
	elseif (t_1 <= 1e+174)
		tmp = Float64(c + Float64(x * y));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (z * t) / 16.0;
	t_2 = -(-0.0625 * (t * z));
	tmp = 0.0;
	if (t_1 <= -5e+170)
		tmp = t_2;
	elseif (t_1 <= 1e+174)
		tmp = c + (x * y);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16), $MachinePrecision]}, Block[{t$95$2 = (-N[(-1/16 * N[(t * z), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[t$95$1, -499999999999999976986103364828435105866493856869550354915370776598145356642472906604169238853083206186863000925026831505293584046586944536955141361661791768572429254787072], t$95$2, If[LessEqual[t$95$1, 1000000000000000068957567536844582937679826098352437099093782830596656320642208754566186799616905285426599982929417458880300383900478261195703581718577367397759832385751351296], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
t_2 := -\frac{-1}{16} \cdot \left(t \cdot z\right)\\
\mathbf{if}\;t\_1 \leq -499999999999999976986103364828435105866493856869550354915370776598145356642472906604169238853083206186863000925026831505293584046586944536955141361661791768572429254787072:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 1000000000000000068957567536844582937679826098352437099093782830596656320642208754566186799616905285426599982929417458880300383900478261195703581718577367397759832385751351296:\\
\;\;\;\;c + x \cdot y\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -4.9999999999999998e170 or 1.0000000000000001e174 < (/.f64 (*.f64 z t) #s(literal 16 binary64))

    1. Initial program 97.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in b around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot a\right)\right) \]
      11. lower-*.f6481.3%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites81.3%

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

      \[\leadsto -1 \cdot \left(-1 \cdot \color{blue}{c}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6421.8%

        \[\leadsto -1 \cdot \left(-1 \cdot c\right) \]
    7. Applied rewrites21.8%

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

        \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot c\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(-1 \cdot c\right) \]
      3. lower-neg.f6421.8%

        \[\leadsto --1 \cdot c \]
      4. lift-*.f64N/A

        \[\leadsto --1 \cdot c \]
      5. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(c\right)\right) \]
      6. lower-neg.f6421.8%

        \[\leadsto -\left(-c\right) \]
    9. Applied rewrites21.8%

      \[\leadsto -\left(-c\right) \]
    10. Taylor expanded in z around inf

      \[\leadsto -\frac{-1}{16} \cdot \left(t \cdot z\right) \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -\frac{-1}{16} \cdot \left(t \cdot z\right) \]
      2. lower-*.f6428.7%

        \[\leadsto -\frac{-1}{16} \cdot \left(t \cdot z\right) \]
    12. Applied rewrites28.7%

      \[\leadsto -\frac{-1}{16} \cdot \left(t \cdot z\right) \]

    if -4.9999999999999998e170 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 1.0000000000000001e174

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
      5. lower-*.f6473.8%

        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
    4. Applied rewrites73.8%

      \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto c + \color{blue}{x \cdot y} \]
    6. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto c + x \cdot \color{blue}{y} \]
      2. lower-*.f6448.6%

        \[\leadsto c + x \cdot y \]
    7. Applied rewrites48.6%

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

Alternative 8: 48.6% accurate, 5.2× speedup?

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

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

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

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

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

      \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{x} \cdot y\right) \]
    4. lower-*.f64N/A

      \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
    5. lower-*.f6473.8%

      \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot \color{blue}{y}\right) \]
  4. Applied rewrites73.8%

    \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
  5. Taylor expanded in z around 0

    \[\leadsto c + \color{blue}{x \cdot y} \]
  6. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto c + x \cdot \color{blue}{y} \]
    2. lower-*.f6448.6%

      \[\leadsto c + x \cdot y \]
  7. Applied rewrites48.6%

    \[\leadsto c + \color{blue}{x \cdot y} \]
  8. Add Preprocessing

Alternative 9: 21.8% accurate, 9.4× speedup?

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

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Taylor expanded in b around -inf

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot a\right)\right) \]
    11. lower-*.f6481.3%

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)}{b} - \frac{-1}{4} \cdot \color{blue}{a}\right)\right) \]
  4. Applied rewrites81.3%

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

    \[\leadsto -1 \cdot \left(-1 \cdot \color{blue}{c}\right) \]
  6. Step-by-step derivation
    1. lower-*.f6421.8%

      \[\leadsto -1 \cdot \left(-1 \cdot c\right) \]
  7. Applied rewrites21.8%

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

      \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot c\right)} \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(-1 \cdot c\right) \]
    3. lower-neg.f6421.8%

      \[\leadsto --1 \cdot c \]
    4. lift-*.f64N/A

      \[\leadsto --1 \cdot c \]
    5. mul-1-negN/A

      \[\leadsto -\left(\mathsf{neg}\left(c\right)\right) \]
    6. lower-neg.f6421.8%

      \[\leadsto -\left(-c\right) \]
  9. Applied rewrites21.8%

    \[\leadsto -\left(-c\right) \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, C"
  :precision binary64
  (+ (- (+ (* x y) (/ (* z t) 16)) (/ (* a b) 4)) c))