Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I

Percentage Accurate: 90.5% → 94.7%
Time: 4.6s
Alternatives: 14
Speedup: 0.5×

Specification

?
\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
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)
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
    code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a):
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}

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

\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
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)
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
    code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a):
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}

Alternative 1: 94.7% accurate, 0.4× speedup?

\[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 7.2 \cdot 10^{-142}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \frac{-\mathsf{min}\left(z, t\right)}{a} \cdot \left(\mathsf{max}\left(z, t\right) \cdot 4.5\right)\right)\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 6 \cdot 10^{+231}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-\mathsf{max}\left(z, t\right), 4.5 \cdot \frac{\mathsf{min}\left(z, t\right)}{a}, \frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (fmax x y) 7.2e-142)
   (fma
    (/ (fmax x y) (+ a a))
    (fmin x y)
    (* (/ (- (fmin z t)) a) (* (fmax z t) 4.5)))
   (if (<= (fmax x y) 6e+231)
     (/ (fma (* (fmax z t) (fmin z t)) -9.0 (* (fmax x y) (fmin x y))) (+ a a))
     (fma
      (- (fmax z t))
      (* 4.5 (/ (fmin z t) a))
      (* (/ (fmin x y) (+ a a)) (fmax x y))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (fmax(x, y) <= 7.2e-142) {
		tmp = fma((fmax(x, y) / (a + a)), fmin(x, y), ((-fmin(z, t) / a) * (fmax(z, t) * 4.5)));
	} else if (fmax(x, y) <= 6e+231) {
		tmp = fma((fmax(z, t) * fmin(z, t)), -9.0, (fmax(x, y) * fmin(x, y))) / (a + a);
	} else {
		tmp = fma(-fmax(z, t), (4.5 * (fmin(z, t) / a)), ((fmin(x, y) / (a + a)) * fmax(x, y)));
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (fmax(x, y) <= 7.2e-142)
		tmp = fma(Float64(fmax(x, y) / Float64(a + a)), fmin(x, y), Float64(Float64(Float64(-fmin(z, t)) / a) * Float64(fmax(z, t) * 4.5)));
	elseif (fmax(x, y) <= 6e+231)
		tmp = Float64(fma(Float64(fmax(z, t) * fmin(z, t)), -9.0, Float64(fmax(x, y) * fmin(x, y))) / Float64(a + a));
	else
		tmp = fma(Float64(-fmax(z, t)), Float64(4.5 * Float64(fmin(z, t) / a)), Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 7.2e-142], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(N[((-N[Min[z, t], $MachinePrecision]) / a), $MachinePrecision] * N[(N[Max[z, t], $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 6e+231], N[(N[(N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[((-N[Max[z, t], $MachinePrecision]) * N[(4.5 * N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 7.2 \cdot 10^{-142}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \frac{-\mathsf{min}\left(z, t\right)}{a} \cdot \left(\mathsf{max}\left(z, t\right) \cdot 4.5\right)\right)\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 6 \cdot 10^{+231}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\mathsf{max}\left(z, t\right), 4.5 \cdot \frac{\mathsf{min}\left(z, t\right)}{a}, \frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 7.20000000000000001e-142

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{y}{a \cdot 2}} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      7. *-commutativeN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a \cdot 2}, x, \mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      9. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a \cdot 2}}, x, \mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      10. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{\color{blue}{a \cdot 2}}, x, \mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{\color{blue}{2 \cdot a}}, x, \mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      12. count-2-revN/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{\color{blue}{a + a}}, x, \mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      13. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{\color{blue}{a + a}}, x, \mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) \]
      14. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2}\right) \]
      16. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right)} \cdot t\right)}{a \cdot 2}\right) \]
      17. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \frac{\mathsf{neg}\left(\color{blue}{z \cdot \left(9 \cdot t\right)}\right)}{a \cdot 2}\right) \]
      18. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \frac{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(9 \cdot t\right)}}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \frac{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(9 \cdot t\right)}{\color{blue}{a \cdot 2}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \color{blue}{\frac{\mathsf{neg}\left(z\right)}{a} \cdot \frac{9 \cdot t}{2}}\right) \]
      21. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \color{blue}{\frac{\mathsf{neg}\left(z\right)}{a} \cdot \frac{9 \cdot t}{2}}\right) \]
      22. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \color{blue}{\frac{\mathsf{neg}\left(z\right)}{a}} \cdot \frac{9 \cdot t}{2}\right) \]
      23. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \frac{\color{blue}{-z}}{a} \cdot \frac{9 \cdot t}{2}\right) \]
    3. Applied rewrites87.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a + a}, x, \frac{-z}{a} \cdot \left(t \cdot 4.5\right)\right)} \]

    if 7.20000000000000001e-142 < y < 6.0000000000000003e231

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(t \cdot z\right) \cdot 9}\right)\right) + x \cdot y}{a \cdot 2} \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t \cdot z, \mathsf{neg}\left(9\right), x \cdot y\right)}}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t \cdot z}, \mathsf{neg}\left(9\right), x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, \color{blue}{-9}, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      15. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a \cdot 2}} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{2 \cdot a}} \]
      17. count-2-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
      18. lower-+.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
    3. Applied rewrites90.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{a + a}} \]

    if 6.0000000000000003e231 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(z \cdot 9\right) \cdot t}}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2} \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{t \cdot \left(z \cdot 9\right)}}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2} \]
      8. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{t \cdot \frac{z \cdot 9}{a \cdot 2}}\right)\right) + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(t\right), \frac{z \cdot 9}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      11. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{-t}, \frac{z \cdot 9}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{\color{blue}{z \cdot 9}}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{\color{blue}{9 \cdot z}}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9 \cdot z}{\color{blue}{a \cdot 2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9 \cdot z}{\color{blue}{2 \cdot a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. times-fracN/A

        \[\leadsto \mathsf{fma}\left(-t, \color{blue}{\frac{9}{2} \cdot \frac{z}{a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \color{blue}{\frac{9}{2} \cdot \frac{z}{a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(-t, \color{blue}{\frac{9}{2}} \cdot \frac{z}{a}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \color{blue}{\frac{z}{a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      22. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      23. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      24. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-t, 4.5 \cdot \frac{z}{a}, \frac{x}{a + a} \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 94.2% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \frac{\mathsf{min}\left(z, t\right)}{a}\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 2.4 \cdot 10^{-138}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \left(t\_1 \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\right)\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 6 \cdot 10^{+231}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-\mathsf{max}\left(z, t\right), 4.5 \cdot t\_1, \frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (fmin z t) a)))
   (if (<= (fmax x y) 2.4e-138)
     (fma (/ (fmax x y) (+ a a)) (fmin x y) (* (* t_1 -4.5) (fmax z t)))
     (if (<= (fmax x y) 6e+231)
       (/
        (fma (* (fmax z t) (fmin z t)) -9.0 (* (fmax x y) (fmin x y)))
        (+ a a))
       (fma
        (- (fmax z t))
        (* 4.5 t_1)
        (* (/ (fmin x y) (+ a a)) (fmax x y)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(z, t) / a;
	double tmp;
	if (fmax(x, y) <= 2.4e-138) {
		tmp = fma((fmax(x, y) / (a + a)), fmin(x, y), ((t_1 * -4.5) * fmax(z, t)));
	} else if (fmax(x, y) <= 6e+231) {
		tmp = fma((fmax(z, t) * fmin(z, t)), -9.0, (fmax(x, y) * fmin(x, y))) / (a + a);
	} else {
		tmp = fma(-fmax(z, t), (4.5 * t_1), ((fmin(x, y) / (a + a)) * fmax(x, y)));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(fmin(z, t) / a)
	tmp = 0.0
	if (fmax(x, y) <= 2.4e-138)
		tmp = fma(Float64(fmax(x, y) / Float64(a + a)), fmin(x, y), Float64(Float64(t_1 * -4.5) * fmax(z, t)));
	elseif (fmax(x, y) <= 6e+231)
		tmp = Float64(fma(Float64(fmax(z, t) * fmin(z, t)), -9.0, Float64(fmax(x, y) * fmin(x, y))) / Float64(a + a));
	else
		tmp = fma(Float64(-fmax(z, t)), Float64(4.5 * t_1), Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 2.4e-138], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(N[(t$95$1 * -4.5), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 6e+231], N[(N[(N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[((-N[Max[z, t], $MachinePrecision]) * N[(4.5 * t$95$1), $MachinePrecision] + N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\mathsf{min}\left(z, t\right)}{a}\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 2.4 \cdot 10^{-138}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \left(t\_1 \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\right)\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 6 \cdot 10^{+231}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\mathsf{max}\left(z, t\right), 4.5 \cdot t\_1, \frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.3999999999999999e-138

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a + a}} \cdot y\right) \]
      2. div-flipN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{1}{\frac{a + a}{x}}} \cdot y\right) \]
      4. lower-unsound-/.f6488.0%

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \frac{1}{\color{blue}{\frac{a + a}{x}}} \cdot y\right) \]
    5. Applied rewrites88.0%

      \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \color{blue}{\frac{1}{\frac{a + a}{x}}} \cdot y\right) \]
    6. Applied rewrites87.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a + a}, x, \left(\frac{z}{a} \cdot -4.5\right) \cdot t\right)} \]

    if 2.3999999999999999e-138 < y < 6.0000000000000003e231

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(t \cdot z\right) \cdot 9}\right)\right) + x \cdot y}{a \cdot 2} \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t \cdot z, \mathsf{neg}\left(9\right), x \cdot y\right)}}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t \cdot z}, \mathsf{neg}\left(9\right), x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, \color{blue}{-9}, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      15. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a \cdot 2}} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{2 \cdot a}} \]
      17. count-2-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
      18. lower-+.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
    3. Applied rewrites90.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{a + a}} \]

    if 6.0000000000000003e231 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(z \cdot 9\right) \cdot t}}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2} \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{t \cdot \left(z \cdot 9\right)}}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2} \]
      8. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{t \cdot \frac{z \cdot 9}{a \cdot 2}}\right)\right) + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(t\right), \frac{z \cdot 9}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      11. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{-t}, \frac{z \cdot 9}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{\color{blue}{z \cdot 9}}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{\color{blue}{9 \cdot z}}{a \cdot 2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9 \cdot z}{\color{blue}{a \cdot 2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9 \cdot z}{\color{blue}{2 \cdot a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. times-fracN/A

        \[\leadsto \mathsf{fma}\left(-t, \color{blue}{\frac{9}{2} \cdot \frac{z}{a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \color{blue}{\frac{9}{2} \cdot \frac{z}{a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(-t, \color{blue}{\frac{9}{2}} \cdot \frac{z}{a}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \color{blue}{\frac{z}{a}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      22. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      23. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      24. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, \frac{9}{2} \cdot \frac{z}{a}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-t, 4.5 \cdot \frac{z}{a}, \frac{x}{a + a} \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 94.1% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \frac{\mathsf{min}\left(z, t\right)}{a}\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 2.4 \cdot 10^{-138}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \left(t\_1 \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\right)\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 6 \cdot 10^{+231}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4.5 \cdot \mathsf{max}\left(z, t\right), t\_1, \mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{a + a}\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (fmin z t) a)))
   (if (<= (fmax x y) 2.4e-138)
     (fma (/ (fmax x y) (+ a a)) (fmin x y) (* (* t_1 -4.5) (fmax z t)))
     (if (<= (fmax x y) 6e+231)
       (/
        (fma (* (fmax z t) (fmin z t)) -9.0 (* (fmax x y) (fmin x y)))
        (+ a a))
       (fma (* -4.5 (fmax z t)) t_1 (* (fmax x y) (/ (fmin x y) (+ a a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(z, t) / a;
	double tmp;
	if (fmax(x, y) <= 2.4e-138) {
		tmp = fma((fmax(x, y) / (a + a)), fmin(x, y), ((t_1 * -4.5) * fmax(z, t)));
	} else if (fmax(x, y) <= 6e+231) {
		tmp = fma((fmax(z, t) * fmin(z, t)), -9.0, (fmax(x, y) * fmin(x, y))) / (a + a);
	} else {
		tmp = fma((-4.5 * fmax(z, t)), t_1, (fmax(x, y) * (fmin(x, y) / (a + a))));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(fmin(z, t) / a)
	tmp = 0.0
	if (fmax(x, y) <= 2.4e-138)
		tmp = fma(Float64(fmax(x, y) / Float64(a + a)), fmin(x, y), Float64(Float64(t_1 * -4.5) * fmax(z, t)));
	elseif (fmax(x, y) <= 6e+231)
		tmp = Float64(fma(Float64(fmax(z, t) * fmin(z, t)), -9.0, Float64(fmax(x, y) * fmin(x, y))) / Float64(a + a));
	else
		tmp = fma(Float64(-4.5 * fmax(z, t)), t_1, Float64(fmax(x, y) * Float64(fmin(x, y) / Float64(a + a))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 2.4e-138], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(N[(t$95$1 * -4.5), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 6e+231], N[(N[(N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[(-4.5 * N[Max[z, t], $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\mathsf{min}\left(z, t\right)}{a}\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 2.4 \cdot 10^{-138}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \left(t\_1 \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\right)\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 6 \cdot 10^{+231}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4.5 \cdot \mathsf{max}\left(z, t\right), t\_1, \mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{a + a}\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.3999999999999999e-138

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a + a}} \cdot y\right) \]
      2. div-flipN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{1}{\frac{a + a}{x}}} \cdot y\right) \]
      4. lower-unsound-/.f6488.0%

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \frac{1}{\color{blue}{\frac{a + a}{x}}} \cdot y\right) \]
    5. Applied rewrites88.0%

      \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \color{blue}{\frac{1}{\frac{a + a}{x}}} \cdot y\right) \]
    6. Applied rewrites87.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a + a}, x, \left(\frac{z}{a} \cdot -4.5\right) \cdot t\right)} \]

    if 2.3999999999999999e-138 < y < 6.0000000000000003e231

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(t \cdot z\right) \cdot 9}\right)\right) + x \cdot y}{a \cdot 2} \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t \cdot z, \mathsf{neg}\left(9\right), x \cdot y\right)}}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t \cdot z}, \mathsf{neg}\left(9\right), x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, \color{blue}{-9}, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      15. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a \cdot 2}} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{2 \cdot a}} \]
      17. count-2-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
      18. lower-+.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
    3. Applied rewrites90.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{a + a}} \]

    if 6.0000000000000003e231 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

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

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

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

        \[\leadsto \color{blue}{\left(\frac{-t}{a} \cdot z\right) \cdot \frac{9}{2}} + \frac{x}{a + a} \cdot y \]
    5. Applied rewrites88.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4.5 \cdot t, \frac{z}{a}, y \cdot \frac{x}{a + a}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 94.1% accurate, 0.5× speedup?

\[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 3 \cdot 10^{-118}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \left(\frac{\mathsf{min}\left(z, t\right)}{a} \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-\mathsf{max}\left(z, t\right)}{a}, \mathsf{min}\left(z, t\right) \cdot 4.5, \frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (fmax x y) 3e-118)
   (fma
    (/ (fmax x y) (+ a a))
    (fmin x y)
    (* (* (/ (fmin z t) a) -4.5) (fmax z t)))
   (fma
    (/ (- (fmax z t)) a)
    (* (fmin z t) 4.5)
    (* (/ (fmin x y) (+ a a)) (fmax x y)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (fmax(x, y) <= 3e-118) {
		tmp = fma((fmax(x, y) / (a + a)), fmin(x, y), (((fmin(z, t) / a) * -4.5) * fmax(z, t)));
	} else {
		tmp = fma((-fmax(z, t) / a), (fmin(z, t) * 4.5), ((fmin(x, y) / (a + a)) * fmax(x, y)));
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (fmax(x, y) <= 3e-118)
		tmp = fma(Float64(fmax(x, y) / Float64(a + a)), fmin(x, y), Float64(Float64(Float64(fmin(z, t) / a) * -4.5) * fmax(z, t)));
	else
		tmp = fma(Float64(Float64(-fmax(z, t)) / a), Float64(fmin(z, t) * 4.5), Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 3e-118], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(N[(N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision] * -4.5), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-N[Max[z, t], $MachinePrecision]) / a), $MachinePrecision] * N[(N[Min[z, t], $MachinePrecision] * 4.5), $MachinePrecision] + N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 3 \cdot 10^{-118}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(x, y\right)}{a + a}, \mathsf{min}\left(x, y\right), \left(\frac{\mathsf{min}\left(z, t\right)}{a} \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-\mathsf{max}\left(z, t\right)}{a}, \mathsf{min}\left(z, t\right) \cdot 4.5, \frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.00000000000000018e-118

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a + a}} \cdot y\right) \]
      2. div-flipN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{1}{\frac{a + a}{x}}} \cdot y\right) \]
      4. lower-unsound-/.f6488.0%

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \frac{1}{\color{blue}{\frac{a + a}{x}}} \cdot y\right) \]
    5. Applied rewrites88.0%

      \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \color{blue}{\frac{1}{\frac{a + a}{x}}} \cdot y\right) \]
    6. Applied rewrites87.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a + a}, x, \left(\frac{z}{a} \cdot -4.5\right) \cdot t\right)} \]

    if 3.00000000000000018e-118 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-t}{a}, z \cdot 4.5, \frac{x}{a + a} \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 92.0% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+292}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+238}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-9 \cdot z, t, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -4e+292)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 1e+238)
       (/ (fma (* -9.0 z) t (* (fmax x y) (fmin x y))) (* a 2.0))
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -4e+292) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+238) {
		tmp = fma((-9.0 * z), t, (fmax(x, y) * fmin(x, y))) / (a * 2.0);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -4e+292)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 1e+238)
		tmp = Float64(fma(Float64(-9.0 * z), t, Float64(fmax(x, y) * fmin(x, y))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+292], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+238], N[(N[(N[(-9.0 * z), $MachinePrecision] * t + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+292}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+238}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-9 \cdot z, t, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.0000000000000001e292 < (*.f64 x y) < 1e238

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. distribute-lft-neg-outN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z \cdot 9\right), t, x \cdot y\right)}}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{z \cdot 9}\right), t, x \cdot y\right)}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{9 \cdot z}\right), t, x \cdot y\right)}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.8%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{-9} \cdot z, t, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.8%

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
    3. Applied rewrites90.8%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}}{a \cdot 2} \]

    if 1e238 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 6: 90.0% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+292}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+238}:\\ \;\;\;\;\frac{t\_1 - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -4e+292)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 1e+238)
       (/ (- t_1 (* (* z 9.0) t)) (* a 2.0))
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -4e+292) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+238) {
		tmp = (t_1 - ((z * 9.0) * t)) / (a * 2.0);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(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)
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) :: t_1
    real(8) :: tmp
    t_1 = fmin(x, y) * fmax(x, y)
    if (t_1 <= (-4d+292)) then
        tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
    else if (t_1 <= 1d+238) then
        tmp = (t_1 - ((z * 9.0d0) * t)) / (a * 2.0d0)
    else
        tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -4e+292) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+238) {
		tmp = (t_1 - ((z * 9.0) * t)) / (a * 2.0);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = fmin(x, y) * fmax(x, y)
	tmp = 0
	if t_1 <= -4e+292:
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
	elif t_1 <= 1e+238:
		tmp = (t_1 - ((z * 9.0) * t)) / (a * 2.0)
	else:
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -4e+292)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 1e+238)
		tmp = Float64(Float64(t_1 - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = min(x, y) * max(x, y);
	tmp = 0.0;
	if (t_1 <= -4e+292)
		tmp = (min(x, y) / (a + a)) * max(x, y);
	elseif (t_1 <= 1e+238)
		tmp = (t_1 - ((z * 9.0) * t)) / (a * 2.0);
	else
		tmp = (max(x, y) / (a + a)) * min(x, y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+292], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+238], N[(N[(t$95$1 - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+292}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+238}:\\
\;\;\;\;\frac{t\_1 - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.0000000000000001e292 < (*.f64 x y) < 1e238

    1. Initial program 90.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]

    if 1e238 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 7: 90.0% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+292}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+238}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t \cdot z, -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -4e+292)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 1e+238)
       (/ (fma (* t z) -9.0 (* (fmax x y) (fmin x y))) (+ a a))
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -4e+292) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+238) {
		tmp = fma((t * z), -9.0, (fmax(x, y) * fmin(x, y))) / (a + a);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -4e+292)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 1e+238)
		tmp = Float64(fma(Float64(t * z), -9.0, Float64(fmax(x, y) * fmin(x, y))) / Float64(a + a));
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+292], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+238], N[(N[(N[(t * z), $MachinePrecision] * -9.0 + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+292}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+238}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t \cdot z, -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.0000000000000001e292 < (*.f64 x y) < 1e238

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(t \cdot z\right) \cdot 9}\right)\right) + x \cdot y}{a \cdot 2} \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t \cdot z, \mathsf{neg}\left(9\right), x \cdot y\right)}}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t \cdot z}, \mathsf{neg}\left(9\right), x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, \color{blue}{-9}, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      15. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a \cdot 2}} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{2 \cdot a}} \]
      17. count-2-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
      18. lower-+.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
    3. Applied rewrites90.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{a + a}} \]

    if 1e238 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 8: 89.9% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \left|a\right| + \left|a\right|\\ \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;\left|a\right| \leq 5 \cdot 10^{-35}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4.5 \cdot \mathsf{max}\left(z, t\right), \frac{\mathsf{min}\left(z, t\right)}{\left|a\right|}, \mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_1}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (fabs a) (fabs a))))
   (*
    (copysign 1.0 a)
    (if (<= (fabs a) 5e-35)
      (/ (fma (* (fmax z t) (fmin z t)) -9.0 (* (fmax x y) (fmin x y))) t_1)
      (fma
       (* -4.5 (fmax z t))
       (/ (fmin z t) (fabs a))
       (* (fmax x y) (/ (fmin x y) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fabs(a) + fabs(a);
	double tmp;
	if (fabs(a) <= 5e-35) {
		tmp = fma((fmax(z, t) * fmin(z, t)), -9.0, (fmax(x, y) * fmin(x, y))) / t_1;
	} else {
		tmp = fma((-4.5 * fmax(z, t)), (fmin(z, t) / fabs(a)), (fmax(x, y) * (fmin(x, y) / t_1)));
	}
	return copysign(1.0, a) * tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(abs(a) + abs(a))
	tmp = 0.0
	if (abs(a) <= 5e-35)
		tmp = Float64(fma(Float64(fmax(z, t) * fmin(z, t)), -9.0, Float64(fmax(x, y) * fmin(x, y))) / t_1);
	else
		tmp = fma(Float64(-4.5 * fmax(z, t)), Float64(fmin(z, t) / abs(a)), Float64(fmax(x, y) * Float64(fmin(x, y) / t_1)));
	end
	return Float64(copysign(1.0, a) * tmp)
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Abs[a], $MachinePrecision] + N[Abs[a], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[a], $MachinePrecision], 5e-35], N[(N[(N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(-4.5 * N[Max[z, t], $MachinePrecision]), $MachinePrecision] * N[(N[Min[z, t], $MachinePrecision] / N[Abs[a], $MachinePrecision]), $MachinePrecision] + N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \left|a\right| + \left|a\right|\\
\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 5 \cdot 10^{-35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right), -9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4.5 \cdot \mathsf{max}\left(z, t\right), \frac{\mathsf{min}\left(z, t\right)}{\left|a\right|}, \mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_1}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.99999999999999964e-35

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right)\right) + x \cdot y}{a \cdot 2} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(t \cdot z\right) \cdot 9}\right)\right) + x \cdot y}{a \cdot 2} \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t \cdot z, \mathsf{neg}\left(9\right), x \cdot y\right)}}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t \cdot z}, \mathsf{neg}\left(9\right), x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, \color{blue}{-9}, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      15. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a \cdot 2}} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{2 \cdot a}} \]
      17. count-2-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
      18. lower-+.f6490.6%

        \[\leadsto \frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{\color{blue}{a + a}} \]
    3. Applied rewrites90.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(t \cdot z, -9, y \cdot x\right)}{a + a}} \]

    if 4.99999999999999964e-35 < a

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

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

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

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

        \[\leadsto \color{blue}{\left(\frac{-t}{a} \cdot z\right) \cdot \frac{9}{2}} + \frac{x}{a + a} \cdot y \]
    5. Applied rewrites88.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4.5 \cdot t, \frac{z}{a}, y \cdot \frac{x}{a + a}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 89.3% accurate, 0.4× speedup?

\[\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;\left|a\right| \leq 10^{+113}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-9 \cdot z, t, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{\left|a\right| \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \frac{\mathsf{max}\left(x, y\right)}{\left|a\right| + \left|a\right|}, \frac{z \cdot t}{\left|a\right|} \cdot -4.5\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (*
  (copysign 1.0 a)
  (if (<= (fabs a) 1e+113)
    (/ (fma (* -9.0 z) t (* (fmax x y) (fmin x y))) (* (fabs a) 2.0))
    (fma
     (fmin x y)
     (/ (fmax x y) (+ (fabs a) (fabs a)))
     (* (/ (* z t) (fabs a)) -4.5)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (fabs(a) <= 1e+113) {
		tmp = fma((-9.0 * z), t, (fmax(x, y) * fmin(x, y))) / (fabs(a) * 2.0);
	} else {
		tmp = fma(fmin(x, y), (fmax(x, y) / (fabs(a) + fabs(a))), (((z * t) / fabs(a)) * -4.5));
	}
	return copysign(1.0, a) * tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (abs(a) <= 1e+113)
		tmp = Float64(fma(Float64(-9.0 * z), t, Float64(fmax(x, y) * fmin(x, y))) / Float64(abs(a) * 2.0));
	else
		tmp = fma(fmin(x, y), Float64(fmax(x, y) / Float64(abs(a) + abs(a))), Float64(Float64(Float64(z * t) / abs(a)) * -4.5));
	end
	return Float64(copysign(1.0, a) * tmp)
end
code[x_, y_, z_, t_, a_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[a], $MachinePrecision], 1e+113], N[(N[(N[(-9.0 * z), $MachinePrecision] * t + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[a], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / N[(N[Abs[a], $MachinePrecision] + N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * t), $MachinePrecision] / N[Abs[a], $MachinePrecision]), $MachinePrecision] * -4.5), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 10^{+113}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-9 \cdot z, t, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{\left|a\right| \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \frac{\mathsf{max}\left(x, y\right)}{\left|a\right| + \left|a\right|}, \frac{z \cdot t}{\left|a\right|} \cdot -4.5\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1e113

    1. Initial program 90.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. sub-flipN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right)}}{a \cdot 2} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)\right) + x \cdot y}}{a \cdot 2} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. distribute-lft-neg-outN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z \cdot 9\right), t, x \cdot y\right)}}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{z \cdot 9}\right), t, x \cdot y\right)}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{9 \cdot z}\right), t, x \cdot y\right)}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval90.8%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{-9} \cdot z, t, x \cdot y\right)}{a \cdot 2} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, \color{blue}{x \cdot y}\right)}{a \cdot 2} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
      14. lower-*.f6490.8%

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, \color{blue}{y \cdot x}\right)}{a \cdot 2} \]
    3. Applied rewrites90.8%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}}{a \cdot 2} \]

    if 1e113 < a

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y - \left(z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. sub-flipN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} + \left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\right)\right) + \frac{x \cdot y}{a \cdot 2}} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{t \cdot \left(z \cdot 9\right)}\right)}{a \cdot 2} + \frac{x \cdot y}{a \cdot 2} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot \left(z \cdot 9\right)}{\color{blue}{a \cdot 2}} + \frac{x \cdot y}{a \cdot 2} \]
      11. times-fracN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(t\right)}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right)} \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{a}}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-t}}{a}, \frac{z \cdot 9}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \frac{\color{blue}{z \cdot 9}}{2}, \frac{x \cdot y}{a \cdot 2}\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, \color{blue}{z \cdot \frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \color{blue}{\frac{9}{2}}, \frac{x \cdot y}{a \cdot 2}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{x \cdot y}}{a \cdot 2}\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \frac{\color{blue}{y \cdot x}}{a \cdot 2}\right) \]
      21. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{y \cdot \frac{x}{a \cdot 2}}\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{a}, z \cdot \frac{9}{2}, \color{blue}{\frac{x}{a \cdot 2} \cdot y}\right) \]
    3. Applied rewrites88.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{y}{a + a}}, \frac{-t}{a} \cdot \left(z \cdot \frac{9}{2}\right)\right) \]
      9. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{-t}{a} \cdot \color{blue}{\left(z \cdot \frac{9}{2}\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \color{blue}{\left(\frac{-t}{a} \cdot z\right) \cdot \frac{9}{2}}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \left(\color{blue}{\frac{-t}{a}} \cdot z\right) \cdot \frac{9}{2}\right) \]
      12. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \left(\frac{\color{blue}{\mathsf{neg}\left(t\right)}}{a} \cdot z\right) \cdot \frac{9}{2}\right) \]
      13. distribute-frac-negN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \left(\color{blue}{\left(\mathsf{neg}\left(\frac{t}{a}\right)\right)} \cdot z\right) \cdot \frac{9}{2}\right) \]
      14. distribute-neg-frac2N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \left(\color{blue}{\frac{t}{\mathsf{neg}\left(a\right)}} \cdot z\right) \cdot \frac{9}{2}\right) \]
      15. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \color{blue}{\frac{t \cdot z}{\mathsf{neg}\left(a\right)}} \cdot \frac{9}{2}\right) \]
      16. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\color{blue}{t \cdot z}}{\mathsf{neg}\left(a\right)} \cdot \frac{9}{2}\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{t \cdot z}{\mathsf{neg}\left(a\right)} \cdot \color{blue}{\frac{9}{2}}\right) \]
      18. times-fracN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \color{blue}{\frac{\left(t \cdot z\right) \cdot 9}{\left(\mathsf{neg}\left(a\right)\right) \cdot 2}}\right) \]
      19. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\color{blue}{\left(t \cdot z\right)} \cdot 9}{\left(\mathsf{neg}\left(a\right)\right) \cdot 2}\right) \]
      20. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\color{blue}{t \cdot \left(z \cdot 9\right)}}{\left(\mathsf{neg}\left(a\right)\right) \cdot 2}\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{t \cdot \color{blue}{\left(9 \cdot z\right)}}{\left(\mathsf{neg}\left(a\right)\right) \cdot 2}\right) \]
      22. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{t \cdot \color{blue}{\left(9 \cdot z\right)}}{\left(\mathsf{neg}\left(a\right)\right) \cdot 2}\right) \]
      23. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\color{blue}{t \cdot \left(9 \cdot z\right)}}{\left(\mathsf{neg}\left(a\right)\right) \cdot 2}\right) \]
      24. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{t \cdot \left(9 \cdot z\right)}{\color{blue}{\mathsf{neg}\left(a \cdot 2\right)}}\right) \]
      25. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{t \cdot \left(9 \cdot z\right)}{\mathsf{neg}\left(\color{blue}{2 \cdot a}\right)}\right) \]
    5. Applied rewrites87.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{a + a}, \frac{z \cdot t}{a} \cdot -4.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 74.3% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+57}:\\ \;\;\;\;\frac{-9 \cdot \left(t \cdot z\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -5e+30)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 1e+57)
       (/ (* -9.0 (* t z)) (* a 2.0))
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+57) {
		tmp = (-9.0 * (t * z)) / (a * 2.0);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(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)
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) :: t_1
    real(8) :: tmp
    t_1 = fmin(x, y) * fmax(x, y)
    if (t_1 <= (-5d+30)) then
        tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
    else if (t_1 <= 1d+57) then
        tmp = ((-9.0d0) * (t * z)) / (a * 2.0d0)
    else
        tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+57) {
		tmp = (-9.0 * (t * z)) / (a * 2.0);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = fmin(x, y) * fmax(x, y)
	tmp = 0
	if t_1 <= -5e+30:
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
	elif t_1 <= 1e+57:
		tmp = (-9.0 * (t * z)) / (a * 2.0)
	else:
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -5e+30)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 1e+57)
		tmp = Float64(Float64(-9.0 * Float64(t * z)) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = min(x, y) * max(x, y);
	tmp = 0.0;
	if (t_1 <= -5e+30)
		tmp = (min(x, y) / (a + a)) * max(x, y);
	elseif (t_1 <= 1e+57)
		tmp = (-9.0 * (t * z)) / (a * 2.0);
	else
		tmp = (max(x, y) / (a + a)) * min(x, y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+30], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+57], N[(N[(-9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+57}:\\
\;\;\;\;\frac{-9 \cdot \left(t \cdot z\right)}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.9999999999999998e30 < (*.f64 x y) < 1.00000000000000005e57

    1. Initial program 90.5%

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

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

        \[\leadsto \frac{-9 \cdot \color{blue}{\left(t \cdot z\right)}}{a \cdot 2} \]
      2. lower-*.f6450.8%

        \[\leadsto \frac{-9 \cdot \left(t \cdot \color{blue}{z}\right)}{a \cdot 2} \]
    4. Applied rewrites50.8%

      \[\leadsto \frac{\color{blue}{-9 \cdot \left(t \cdot z\right)}}{a \cdot 2} \]

    if 1.00000000000000005e57 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 11: 74.3% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+57}:\\ \;\;\;\;\frac{\left(z \cdot t\right) \cdot -4.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -5e+30)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 1e+57)
       (/ (* (* z t) -4.5) a)
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+57) {
		tmp = ((z * t) * -4.5) / a;
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(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)
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) :: t_1
    real(8) :: tmp
    t_1 = fmin(x, y) * fmax(x, y)
    if (t_1 <= (-5d+30)) then
        tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
    else if (t_1 <= 1d+57) then
        tmp = ((z * t) * (-4.5d0)) / a
    else
        tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+57) {
		tmp = ((z * t) * -4.5) / a;
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = fmin(x, y) * fmax(x, y)
	tmp = 0
	if t_1 <= -5e+30:
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
	elif t_1 <= 1e+57:
		tmp = ((z * t) * -4.5) / a
	else:
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -5e+30)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 1e+57)
		tmp = Float64(Float64(Float64(z * t) * -4.5) / a);
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = min(x, y) * max(x, y);
	tmp = 0.0;
	if (t_1 <= -5e+30)
		tmp = (min(x, y) / (a + a)) * max(x, y);
	elseif (t_1 <= 1e+57)
		tmp = ((z * t) * -4.5) / a;
	else
		tmp = (max(x, y) / (a + a)) * min(x, y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+30], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+57], N[(N[(N[(z * t), $MachinePrecision] * -4.5), $MachinePrecision] / a), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+57}:\\
\;\;\;\;\frac{\left(z \cdot t\right) \cdot -4.5}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.9999999999999998e30 < (*.f64 x y) < 1.00000000000000005e57

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{-9}{2} \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \color{blue}{\frac{t \cdot z}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
      3. lower-*.f6450.8%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} \]
    4. Applied rewrites50.8%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \color{blue}{\frac{t \cdot z}{a}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
      3. associate-*r/N/A

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

        \[\leadsto \frac{\frac{-9}{2} \cdot \left(t \cdot z\right)}{\color{blue}{a}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\left(t \cdot z\right) \cdot \frac{-9}{2}}{a} \]
      6. lower-*.f6450.8%

        \[\leadsto \frac{\left(t \cdot z\right) \cdot -4.5}{a} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\left(t \cdot z\right) \cdot \frac{-9}{2}}{a} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\left(z \cdot t\right) \cdot \frac{-9}{2}}{a} \]
      9. lower-*.f6450.8%

        \[\leadsto \frac{\left(z \cdot t\right) \cdot -4.5}{a} \]
    6. Applied rewrites50.8%

      \[\leadsto \frac{\left(z \cdot t\right) \cdot -4.5}{\color{blue}{a}} \]

    if 1.00000000000000005e57 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 12: 74.3% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+57}:\\ \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -5e+30)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 1e+57)
       (* -4.5 (/ (* t z) a))
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+57) {
		tmp = -4.5 * ((t * z) / a);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(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)
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) :: t_1
    real(8) :: tmp
    t_1 = fmin(x, y) * fmax(x, y)
    if (t_1 <= (-5d+30)) then
        tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
    else if (t_1 <= 1d+57) then
        tmp = (-4.5d0) * ((t * z) / a)
    else
        tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 1e+57) {
		tmp = -4.5 * ((t * z) / a);
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = fmin(x, y) * fmax(x, y)
	tmp = 0
	if t_1 <= -5e+30:
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
	elif t_1 <= 1e+57:
		tmp = -4.5 * ((t * z) / a)
	else:
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -5e+30)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 1e+57)
		tmp = Float64(-4.5 * Float64(Float64(t * z) / a));
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = min(x, y) * max(x, y);
	tmp = 0.0;
	if (t_1 <= -5e+30)
		tmp = (min(x, y) / (a + a)) * max(x, y);
	elseif (t_1 <= 1e+57)
		tmp = -4.5 * ((t * z) / a);
	else
		tmp = (max(x, y) / (a + a)) * min(x, y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+30], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+57], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+57}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.9999999999999998e30 < (*.f64 x y) < 1.00000000000000005e57

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{-9}{2} \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \color{blue}{\frac{t \cdot z}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
      3. lower-*.f6450.8%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} \]
    4. Applied rewrites50.8%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]

    if 1.00000000000000005e57 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 13: 74.0% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+56}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (fmin x y) (fmax x y))))
   (if (<= t_1 -5e+30)
     (* (/ (fmin x y) (+ a a)) (fmax x y))
     (if (<= t_1 2e+56)
       (* -4.5 (* z (/ t a)))
       (* (/ (fmax x y) (+ a a)) (fmin x y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 2e+56) {
		tmp = -4.5 * (z * (t / a));
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(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)
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) :: t_1
    real(8) :: tmp
    t_1 = fmin(x, y) * fmax(x, y)
    if (t_1 <= (-5d+30)) then
        tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
    else if (t_1 <= 2d+56) then
        tmp = (-4.5d0) * (z * (t / a))
    else
        tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = fmin(x, y) * fmax(x, y);
	double tmp;
	if (t_1 <= -5e+30) {
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y);
	} else if (t_1 <= 2e+56) {
		tmp = -4.5 * (z * (t / a));
	} else {
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = fmin(x, y) * fmax(x, y)
	tmp = 0
	if t_1 <= -5e+30:
		tmp = (fmin(x, y) / (a + a)) * fmax(x, y)
	elif t_1 <= 2e+56:
		tmp = -4.5 * (z * (t / a))
	else:
		tmp = (fmax(x, y) / (a + a)) * fmin(x, y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(fmin(x, y) * fmax(x, y))
	tmp = 0.0
	if (t_1 <= -5e+30)
		tmp = Float64(Float64(fmin(x, y) / Float64(a + a)) * fmax(x, y));
	elseif (t_1 <= 2e+56)
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	else
		tmp = Float64(Float64(fmax(x, y) / Float64(a + a)) * fmin(x, y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = min(x, y) * max(x, y);
	tmp = 0.0;
	if (t_1 <= -5e+30)
		tmp = (min(x, y) / (a + a)) * max(x, y);
	elseif (t_1 <= 2e+56)
		tmp = -4.5 * (z * (t / a));
	else
		tmp = (max(x, y) / (a + a)) * min(x, y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+30], N[(N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+56], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+30}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a + a} \cdot \mathsf{max}\left(x, y\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+56}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{a + a} \cdot \mathsf{min}\left(x, y\right)\\


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

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
      9. count-2N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
      11. associate-*l/N/A

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
      12. lift-/.f64N/A

        \[\leadsto \frac{x}{a + a} \cdot y \]
      13. lower-*.f6450.9%

        \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    6. Applied rewrites50.9%

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

    if -4.9999999999999998e30 < (*.f64 x y) < 2.00000000000000018e56

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{-9}{2} \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \color{blue}{\frac{t \cdot z}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
      3. lower-*.f6450.8%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} \]
    4. Applied rewrites50.8%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{a} \]
      3. *-commutativeN/A

        \[\leadsto \frac{-9}{2} \cdot \frac{z \cdot t}{a} \]
      4. associate-/l*N/A

        \[\leadsto \frac{-9}{2} \cdot \left(z \cdot \color{blue}{\frac{t}{a}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \frac{-9}{2} \cdot \left(z \cdot \color{blue}{\frac{t}{a}}\right) \]
      6. lower-/.f6452.6%

        \[\leadsto -4.5 \cdot \left(z \cdot \frac{t}{\color{blue}{a}}\right) \]
    6. Applied rewrites52.6%

      \[\leadsto -4.5 \cdot \left(z \cdot \color{blue}{\frac{t}{a}}\right) \]

    if 2.00000000000000018e56 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
      3. lower-*.f6449.7%

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
      4. mult-flip-revN/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
      6. associate-/r*N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
      8. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{a} \cdot 2} \]
      9. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{2 \cdot \color{blue}{a}} \]
      10. count-2N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{y \cdot x}{a + \color{blue}{a}} \]
      12. associate-*l/N/A

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{y}{a + a} \cdot x \]
      14. lower-*.f6450.4%

        \[\leadsto \frac{y}{a + a} \cdot \color{blue}{x} \]
    6. Applied rewrites50.4%

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

Alternative 14: 50.9% accurate, 1.9× speedup?

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

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

    \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{a}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
    2. lower-/.f64N/A

      \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{\color{blue}{a}} \]
    3. lower-*.f6449.7%

      \[\leadsto 0.5 \cdot \frac{x \cdot y}{a} \]
  4. Applied rewrites49.7%

    \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
    2. *-commutativeN/A

      \[\leadsto \frac{x \cdot y}{a} \cdot \color{blue}{\frac{1}{2}} \]
    3. metadata-evalN/A

      \[\leadsto \frac{x \cdot y}{a} \cdot \frac{1}{\color{blue}{2}} \]
    4. mult-flip-revN/A

      \[\leadsto \frac{\frac{x \cdot y}{a}}{\color{blue}{2}} \]
    5. lift-/.f64N/A

      \[\leadsto \frac{\frac{x \cdot y}{a}}{2} \]
    6. associate-/r*N/A

      \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{x \cdot y}{\color{blue}{a} \cdot 2} \]
    8. *-commutativeN/A

      \[\leadsto \frac{x \cdot y}{2 \cdot \color{blue}{a}} \]
    9. count-2N/A

      \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
    10. lift-+.f64N/A

      \[\leadsto \frac{x \cdot y}{a + \color{blue}{a}} \]
    11. associate-*l/N/A

      \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
    12. lift-/.f64N/A

      \[\leadsto \frac{x}{a + a} \cdot y \]
    13. lower-*.f6450.9%

      \[\leadsto \frac{x}{a + a} \cdot \color{blue}{y} \]
  6. Applied rewrites50.9%

    \[\leadsto \color{blue}{\frac{x}{a + a} \cdot y} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2025183 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"
  :precision binary64
  (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))