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

Percentage Accurate: 78.8% → 93.0%
Time: 5.8s
Alternatives: 17
Speedup: 0.8×

Specification

?
\[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c):
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 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: 78.8% accurate, 1.0× speedup?

\[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c):
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}

Alternative 1: 93.0% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), 9, b\right)\right) \cdot \frac{1}{c \cdot z}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.9999999999999995e32 or 5.2000000000000001e74 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} - \left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)}{c} \]
      3. sub-flipN/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      6. associate-/l*N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \left(x \cdot \frac{y}{z}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      7. associate-*l*N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      10. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(b\right)}{z}\right)\right)\right)}{c} \]
      11. distribute-frac-neg2N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(z\right)}\right)}{c} \]
      12. frac-2negN/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \frac{b}{z}\right)}{c} \]
      13. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, 9 \cdot x, \frac{b}{z}\right)\right)}{c} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]
      17. lower-*.f6484.7

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]
    8. Applied rewrites84.7%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]

    if -9.9999999999999995e32 < z < 5.2000000000000001e74

    1. Initial program 78.8%

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

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

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

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

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

Alternative 2: 92.9% accurate, 0.7× speedup?

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

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+74}:\\
\;\;\;\;\frac{\left(t\_1 \cdot \mathsf{max}\left(x, y\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5000000000000004e-37 or 5.2000000000000001e74 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} - \left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)}{c} \]
      3. sub-flipN/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      6. associate-/l*N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \left(x \cdot \frac{y}{z}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      7. associate-*l*N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      10. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(b\right)}{z}\right)\right)\right)}{c} \]
      11. distribute-frac-neg2N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(z\right)}\right)}{c} \]
      12. frac-2negN/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \frac{b}{z}\right)}{c} \]
      13. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, 9 \cdot x, \frac{b}{z}\right)\right)}{c} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]
      17. lower-*.f6484.7

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]
    8. Applied rewrites84.7%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]

    if -7.5000000000000004e-37 < z < 5.2000000000000001e74

    1. Initial program 78.8%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 92.9% accurate, 0.7× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2e21 or 5.2000000000000001e74 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} - \left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)}{c} \]
      3. sub-flipN/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      6. associate-/l*N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \left(x \cdot \frac{y}{z}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      7. associate-*l*N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{z}\right)\right)\right)\right)\right)}{c} \]
      10. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(b\right)}{z}\right)\right)\right)}{c} \]
      11. distribute-frac-neg2N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(z\right)}\right)}{c} \]
      12. frac-2negN/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{y}{z} \cdot \left(9 \cdot x\right) + \frac{b}{z}\right)}{c} \]
      13. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, 9 \cdot x, \frac{b}{z}\right)\right)}{c} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]
      17. lower-*.f6484.7

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]
    8. Applied rewrites84.7%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(\frac{y}{z}, x \cdot 9, \frac{b}{z}\right)\right)}{c} \]

    if -2.2e21 < z < 5.2000000000000001e74

    1. Initial program 78.8%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) + b}{z \cdot c} \]
      4. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \color{blue}{\left(y \cdot 9\right)} \cdot x + b\right)}{z \cdot c} \]
      7. lower-fma.f6479.2

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(\color{blue}{9 \cdot y}, x, b\right)\right)}{z \cdot c} \]
      10. lower-*.f6479.2

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

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

Alternative 4: 91.2% accurate, 0.8× speedup?

\[\begin{array}{l} t_1 := \mathsf{fma}\left(-4 \cdot t, a, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right) \cdot \frac{1}{c}\\ \mathbf{if}\;z \leq -1.24 \cdot 10^{-29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-51}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(9 \cdot y, x, b\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (fma (* -4.0 t) a (/ (fma (* y x) 9.0 b) z)) (/ 1.0 c))))
   (if (<= z -1.24e-29)
     t_1
     (if (<= z 2e-51)
       (/ (fma (* (* -4.0 z) a) t (fma (* 9.0 y) x b)) (* z c))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = fma((-4.0 * t), a, (fma((y * x), 9.0, b) / z)) * (1.0 / c);
	double tmp;
	if (z <= -1.24e-29) {
		tmp = t_1;
	} else if (z <= 2e-51) {
		tmp = fma(((-4.0 * z) * a), t, fma((9.0 * y), x, b)) / (z * c);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = Float64(fma(Float64(-4.0 * t), a, Float64(fma(Float64(y * x), 9.0, b) / z)) * Float64(1.0 / c))
	tmp = 0.0
	if (z <= -1.24e-29)
		tmp = t_1;
	elseif (z <= 2e-51)
		tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(9.0 * y), x, b)) / Float64(z * c));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.24e-29], t$95$1, If[LessEqual[z, 2e-51], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4 \cdot t, a, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right) \cdot \frac{1}{c}\\
\mathbf{if}\;z \leq -1.24 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(9 \cdot y, x, b\right)\right)}{z \cdot c}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.23999999999999996e-29 or 2e-51 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \frac{1}{\color{blue}{c}} \]
      4. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \color{blue}{\frac{1}{c}} \]
    8. Applied rewrites86.5%

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

    if -1.23999999999999996e-29 < z < 2e-51

    1. Initial program 78.8%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) + b}{z \cdot c} \]
      4. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \color{blue}{\left(y \cdot 9\right)} \cdot x + b\right)}{z \cdot c} \]
      7. lower-fma.f6479.2

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(\color{blue}{9 \cdot y}, x, b\right)\right)}{z \cdot c} \]
      10. lower-*.f6479.2

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

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

Alternative 5: 84.4% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, t\_1, \frac{b}{z}\right)}{c}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.45000000000000022e83

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c} + \frac{b}{c \cdot z}} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      5. lower-*.f6461.7

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
    6. Applied rewrites61.7%

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

    if -4.45000000000000022e83 < z < 5.2000000000000001e74

    1. Initial program 78.8%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) + b}{z \cdot c} \]
      4. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \color{blue}{\left(y \cdot 9\right)} \cdot x + b\right)}{z \cdot c} \]
      7. lower-fma.f6479.2

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(\color{blue}{9 \cdot y}, x, b\right)\right)}{z \cdot c} \]
      10. lower-*.f6479.2

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

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

    if 5.2000000000000001e74 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6462.6

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites62.6%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 83.8% accurate, 0.8× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+175}:\\ \;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+74}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -1.4e+175)
   (fma -4.0 (/ (* a t) c) (/ b (* c z)))
   (if (<= z 5.2e+74)
     (/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) b)) (* z c))
     (/ (fma -4.0 (* a t) (/ b z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -1.4e+175) {
		tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
	} else if (z <= 5.2e+74) {
		tmp = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), b)) / (z * c);
	} else {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -1.4e+175)
		tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z)));
	elseif (z <= 5.2e+74)
		tmp = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c));
	else
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.4e+175], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+74], N[(N[(N[(y * 9.0), $MachinePrecision] * x + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+175}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+74}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4000000000000001e175

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c} + \frac{b}{c \cdot z}} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      5. lower-*.f6461.7

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
    6. Applied rewrites61.7%

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

    if -1.4000000000000001e175 < z < 5.2000000000000001e74

    1. Initial program 78.8%

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      5. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{y \cdot 9}, x, \left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}{z \cdot c} \]
      14. add-flip-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a + b}\right)}{z \cdot c} \]
    3. Applied rewrites79.8%

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

    if 5.2000000000000001e74 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6462.6

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites62.6%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 83.7% accurate, 0.8× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+175}:\\ \;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+74}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4 \cdot z, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -1.4e+175)
   (fma -4.0 (/ (* a t) c) (/ b (* c z)))
   (if (<= z 5.2e+74)
     (/ (fma (* a t) (* -4.0 z) (fma (* y x) 9.0 b)) (* z c))
     (/ (fma -4.0 (* a t) (/ b z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -1.4e+175) {
		tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
	} else if (z <= 5.2e+74) {
		tmp = fma((a * t), (-4.0 * z), fma((y * x), 9.0, b)) / (z * c);
	} else {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -1.4e+175)
		tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z)));
	elseif (z <= 5.2e+74)
		tmp = Float64(fma(Float64(a * t), Float64(-4.0 * z), fma(Float64(y * x), 9.0, b)) / Float64(z * c));
	else
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.4e+175], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+74], N[(N[(N[(a * t), $MachinePrecision] * N[(-4.0 * z), $MachinePrecision] + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+175}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+74}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4 \cdot z, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4000000000000001e175

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c} + \frac{b}{c \cdot z}} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      5. lower-*.f6461.7

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
    6. Applied rewrites61.7%

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

    if -1.4000000000000001e175 < z < 5.2000000000000001e74

    1. Initial program 78.8%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) + b}{z \cdot c} \]
      4. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000001e74 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6462.6

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites62.6%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 74.7% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -0.00245:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-153}:\\ \;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -0.00245)
   (/ (fma -4.0 (* a t) (/ b z)) c)
   (if (<= z 5e-153)
     (/ (+ b (* 9.0 (* x y))) (* z c))
     (fma -4.0 (/ (* a t) c) (/ b (* c z))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.00245) {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	} else if (z <= 5e-153) {
		tmp = (b + (9.0 * (x * y))) / (z * c);
	} else {
		tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -0.00245)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	elseif (z <= 5e-153)
		tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c));
	else
		tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -0.00245], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 5e-153], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -0.00245:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-153}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.0024499999999999999

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6462.6

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites62.6%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]

    if -0.0024499999999999999 < z < 5.00000000000000033e-153

    1. Initial program 78.8%

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

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

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

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6459.9

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites59.9%

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]

    if 5.00000000000000033e-153 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c} + \frac{b}{c \cdot z}} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      5. lower-*.f6461.7

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
    6. Applied rewrites61.7%

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

Alternative 9: 73.9% accurate, 1.2× speedup?

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{-91}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.0024499999999999999 or 3.30000000000000011e-91 < z

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6462.6

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites62.6%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]

    if -0.0024499999999999999 < z < 3.30000000000000011e-91

    1. Initial program 78.8%

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

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

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

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6459.9

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites59.9%

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

Alternative 10: 72.1% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+91}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\

\mathbf{else}:\\
\;\;\;\;\left(\mathsf{max}\left(x, y\right) \cdot 9\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{z \cdot c}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.00000000000000009e150

    1. Initial program 78.8%

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

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lower-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. lower-*.f6435.6

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites35.6%

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lift-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. associate-/l*N/A

        \[\leadsto 9 \cdot \left(x \cdot \color{blue}{\frac{y}{c \cdot z}}\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \frac{\left(9 \cdot x\right) \cdot y}{\color{blue}{c \cdot z}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{y \cdot \left(9 \cdot x\right)}{\color{blue}{c} \cdot z} \]
      8. associate-/l*N/A

        \[\leadsto y \cdot \color{blue}{\frac{9 \cdot x}{c \cdot z}} \]
      9. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{9 \cdot x}{c \cdot z}} \]
      10. lower-/.f64N/A

        \[\leadsto y \cdot \frac{9 \cdot x}{\color{blue}{c \cdot z}} \]
      11. *-commutativeN/A

        \[\leadsto y \cdot \frac{x \cdot 9}{\color{blue}{c} \cdot z} \]
      12. lower-*.f6437.8

        \[\leadsto y \cdot \frac{x \cdot 9}{\color{blue}{c} \cdot z} \]
      13. lift-*.f64N/A

        \[\leadsto y \cdot \frac{x \cdot 9}{c \cdot \color{blue}{z}} \]
      14. *-commutativeN/A

        \[\leadsto y \cdot \frac{x \cdot 9}{z \cdot \color{blue}{c}} \]
      15. lift-*.f6437.8

        \[\leadsto y \cdot \frac{x \cdot 9}{z \cdot \color{blue}{c}} \]
    6. Applied rewrites37.8%

      \[\leadsto y \cdot \color{blue}{\frac{x \cdot 9}{z \cdot c}} \]

    if -5.00000000000000009e150 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000016e91

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6462.6

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites62.6%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]

    if 2.00000000000000016e91 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 78.8%

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

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lower-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. lower-*.f6435.6

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites35.6%

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lift-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. associate-/l*N/A

        \[\leadsto 9 \cdot \left(x \cdot \color{blue}{\frac{y}{c \cdot z}}\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \frac{\left(9 \cdot x\right) \cdot y}{\color{blue}{c \cdot z}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{y \cdot \left(9 \cdot x\right)}{\color{blue}{c} \cdot z} \]
      8. associate-*l*N/A

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

        \[\leadsto \left(y \cdot 9\right) \cdot \color{blue}{\frac{x}{c \cdot z}} \]
      10. lower-*.f64N/A

        \[\leadsto \left(y \cdot 9\right) \cdot \color{blue}{\frac{x}{c \cdot z}} \]
      11. lower-*.f64N/A

        \[\leadsto \left(y \cdot 9\right) \cdot \frac{\color{blue}{x}}{c \cdot z} \]
      12. lower-/.f6437.7

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

        \[\leadsto \left(y \cdot 9\right) \cdot \frac{x}{c \cdot \color{blue}{z}} \]
      14. *-commutativeN/A

        \[\leadsto \left(y \cdot 9\right) \cdot \frac{x}{z \cdot \color{blue}{c}} \]
      15. lift-*.f6437.7

        \[\leadsto \left(y \cdot 9\right) \cdot \frac{x}{z \cdot \color{blue}{c}} \]
    6. Applied rewrites37.7%

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

Alternative 11: 49.3% accurate, 1.1× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -0.106:\\ \;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-192}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-268}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{9}{z \cdot c}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{1}{c \cdot z} \cdot b\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -0.106)
   (* (* -4.0 (* a t)) (/ 1.0 c))
   (if (<= z -9e-192)
     (/ (/ b c) z)
     (if (<= z -1e-268)
       (* (* y x) (/ 9.0 (* z c)))
       (if (<= z 6.4e-52) (* (/ 1.0 (* c z)) b) (* -4.0 (/ (* a t) c)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= -9e-192) {
		tmp = (b / c) / z;
	} else if (z <= -1e-268) {
		tmp = (y * x) * (9.0 / (z * c));
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (z <= (-0.106d0)) then
        tmp = ((-4.0d0) * (a * t)) * (1.0d0 / c)
    else if (z <= (-9d-192)) then
        tmp = (b / c) / z
    else if (z <= (-1d-268)) then
        tmp = (y * x) * (9.0d0 / (z * c))
    else if (z <= 6.4d-52) then
        tmp = (1.0d0 / (c * z)) * b
    else
        tmp = (-4.0d0) * ((a * t) / c)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= -9e-192) {
		tmp = (b / c) / z;
	} else if (z <= -1e-268) {
		tmp = (y * x) * (9.0 / (z * c));
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if z <= -0.106:
		tmp = (-4.0 * (a * t)) * (1.0 / c)
	elif z <= -9e-192:
		tmp = (b / c) / z
	elif z <= -1e-268:
		tmp = (y * x) * (9.0 / (z * c))
	elif z <= 6.4e-52:
		tmp = (1.0 / (c * z)) * b
	else:
		tmp = -4.0 * ((a * t) / c)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -0.106)
		tmp = Float64(Float64(-4.0 * Float64(a * t)) * Float64(1.0 / c));
	elseif (z <= -9e-192)
		tmp = Float64(Float64(b / c) / z);
	elseif (z <= -1e-268)
		tmp = Float64(Float64(y * x) * Float64(9.0 / Float64(z * c)));
	elseif (z <= 6.4e-52)
		tmp = Float64(Float64(1.0 / Float64(c * z)) * b);
	else
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (z <= -0.106)
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	elseif (z <= -9e-192)
		tmp = (b / c) / z;
	elseif (z <= -1e-268)
		tmp = (y * x) * (9.0 / (z * c));
	elseif (z <= 6.4e-52)
		tmp = (1.0 / (c * z)) * b;
	else
		tmp = -4.0 * ((a * t) / c);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -0.106], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-192], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1e-268], N[(N[(y * x), $MachinePrecision] * N[(9.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-52], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -0.106:\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\

\mathbf{elif}\;z \leq -9 \cdot 10^{-192}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-268}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{9}{z \cdot c}\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\

\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -0.105999999999999997

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \frac{1}{\color{blue}{c}} \]
      4. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \color{blue}{\frac{1}{c}} \]
    8. Applied rewrites86.5%

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
      2. lower-*.f6437.6

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
    11. Applied rewrites37.6%

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

    if -0.105999999999999997 < z < -9.00000000000000048e-192

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]
    5. Step-by-step derivation
      1. lower-/.f6434.4

        \[\leadsto \frac{\frac{b}{\color{blue}{c}}}{z} \]
    6. Applied rewrites34.4%

      \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]

    if -9.00000000000000048e-192 < z < -9.99999999999999958e-269

    1. Initial program 78.8%

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

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lower-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. lower-*.f6435.6

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites35.6%

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

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

        \[\leadsto \frac{x \cdot y}{c \cdot z} \cdot \color{blue}{9} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{x \cdot y}{c \cdot z} \cdot 9 \]
      4. associate-*l/N/A

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

        \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{9}{c \cdot z}} \]
      6. lower-*.f64N/A

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{9}}{c \cdot z} \]
      8. *-commutativeN/A

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

        \[\leadsto \left(y \cdot x\right) \cdot \frac{\color{blue}{9}}{c \cdot z} \]
      10. lower-/.f6435.7

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

        \[\leadsto \left(y \cdot x\right) \cdot \frac{9}{c \cdot \color{blue}{z}} \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot \frac{9}{z \cdot \color{blue}{c}} \]
      13. lift-*.f6435.7

        \[\leadsto \left(y \cdot x\right) \cdot \frac{9}{z \cdot \color{blue}{c}} \]
    6. Applied rewrites35.7%

      \[\leadsto \left(y \cdot x\right) \cdot \color{blue}{\frac{9}{z \cdot c}} \]

    if -9.99999999999999958e-269 < z < 6.4000000000000002e-52

    1. Initial program 78.8%

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

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. lower-*.f6434.7

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.7%

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. mult-flipN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{c \cdot \color{blue}{z}} \]
      4. *-commutativeN/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      8. lower-/.f6434.8

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      9. lift-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      10. *-commutativeN/A

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
      11. lift-*.f6434.8

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
    6. Applied rewrites34.8%

      \[\leadsto \frac{1}{c \cdot z} \cdot \color{blue}{b} \]

    if 6.4000000000000002e-52 < z

    1. Initial program 78.8%

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
      3. lower-*.f6437.7

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 12: 49.3% accurate, 0.9× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -0.106:\\ \;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-192}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-268}:\\ \;\;\;\;\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right) \cdot 9}{z \cdot c}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{1}{c \cdot z} \cdot b\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -0.106)
   (* (* -4.0 (* a t)) (/ 1.0 c))
   (if (<= z -9e-192)
     (/ (/ b c) z)
     (if (<= z -1e-268)
       (* (fmin x y) (/ (* (fmax x y) 9.0) (* z c)))
       (if (<= z 6.4e-52) (* (/ 1.0 (* c z)) b) (* -4.0 (/ (* a t) c)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= -9e-192) {
		tmp = (b / c) / z;
	} else if (z <= -1e-268) {
		tmp = fmin(x, y) * ((fmax(x, y) * 9.0) / (z * c));
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (z <= (-0.106d0)) then
        tmp = ((-4.0d0) * (a * t)) * (1.0d0 / c)
    else if (z <= (-9d-192)) then
        tmp = (b / c) / z
    else if (z <= (-1d-268)) then
        tmp = fmin(x, y) * ((fmax(x, y) * 9.0d0) / (z * c))
    else if (z <= 6.4d-52) then
        tmp = (1.0d0 / (c * z)) * b
    else
        tmp = (-4.0d0) * ((a * t) / c)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= -9e-192) {
		tmp = (b / c) / z;
	} else if (z <= -1e-268) {
		tmp = fmin(x, y) * ((fmax(x, y) * 9.0) / (z * c));
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if z <= -0.106:
		tmp = (-4.0 * (a * t)) * (1.0 / c)
	elif z <= -9e-192:
		tmp = (b / c) / z
	elif z <= -1e-268:
		tmp = fmin(x, y) * ((fmax(x, y) * 9.0) / (z * c))
	elif z <= 6.4e-52:
		tmp = (1.0 / (c * z)) * b
	else:
		tmp = -4.0 * ((a * t) / c)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -0.106)
		tmp = Float64(Float64(-4.0 * Float64(a * t)) * Float64(1.0 / c));
	elseif (z <= -9e-192)
		tmp = Float64(Float64(b / c) / z);
	elseif (z <= -1e-268)
		tmp = Float64(fmin(x, y) * Float64(Float64(fmax(x, y) * 9.0) / Float64(z * c)));
	elseif (z <= 6.4e-52)
		tmp = Float64(Float64(1.0 / Float64(c * z)) * b);
	else
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (z <= -0.106)
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	elseif (z <= -9e-192)
		tmp = (b / c) / z;
	elseif (z <= -1e-268)
		tmp = min(x, y) * ((max(x, y) * 9.0) / (z * c));
	elseif (z <= 6.4e-52)
		tmp = (1.0 / (c * z)) * b;
	else
		tmp = -4.0 * ((a * t) / c);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -0.106], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-192], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1e-268], N[(N[Min[x, y], $MachinePrecision] * N[(N[(N[Max[x, y], $MachinePrecision] * 9.0), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-52], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -0.106:\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\

\mathbf{elif}\;z \leq -9 \cdot 10^{-192}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-268}:\\
\;\;\;\;\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right) \cdot 9}{z \cdot c}\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\

\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -0.105999999999999997

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \frac{1}{\color{blue}{c}} \]
      4. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \color{blue}{\frac{1}{c}} \]
    8. Applied rewrites86.5%

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
      2. lower-*.f6437.6

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
    11. Applied rewrites37.6%

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

    if -0.105999999999999997 < z < -9.00000000000000048e-192

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]
    5. Step-by-step derivation
      1. lower-/.f6434.4

        \[\leadsto \frac{\frac{b}{\color{blue}{c}}}{z} \]
    6. Applied rewrites34.4%

      \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]

    if -9.00000000000000048e-192 < z < -9.99999999999999958e-269

    1. Initial program 78.8%

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

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lower-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. lower-*.f6435.6

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites35.6%

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lift-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. associate-/l*N/A

        \[\leadsto 9 \cdot \left(x \cdot \color{blue}{\frac{y}{c \cdot z}}\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \frac{\left(9 \cdot x\right) \cdot y}{\color{blue}{c \cdot z}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{y \cdot \left(9 \cdot x\right)}{\color{blue}{c} \cdot z} \]
      8. associate-*l*N/A

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

        \[\leadsto \frac{x \cdot \left(y \cdot 9\right)}{\color{blue}{c} \cdot z} \]
      10. associate-/l*N/A

        \[\leadsto x \cdot \color{blue}{\frac{y \cdot 9}{c \cdot z}} \]
      11. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y \cdot 9}{c \cdot z}} \]
      12. lower-/.f64N/A

        \[\leadsto x \cdot \frac{y \cdot 9}{\color{blue}{c \cdot z}} \]
      13. lower-*.f6437.6

        \[\leadsto x \cdot \frac{y \cdot 9}{\color{blue}{c} \cdot z} \]
      14. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y \cdot 9}{c \cdot \color{blue}{z}} \]
      15. *-commutativeN/A

        \[\leadsto x \cdot \frac{y \cdot 9}{z \cdot \color{blue}{c}} \]
      16. lift-*.f6437.6

        \[\leadsto x \cdot \frac{y \cdot 9}{z \cdot \color{blue}{c}} \]
    6. Applied rewrites37.6%

      \[\leadsto x \cdot \color{blue}{\frac{y \cdot 9}{z \cdot c}} \]

    if -9.99999999999999958e-269 < z < 6.4000000000000002e-52

    1. Initial program 78.8%

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

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. lower-*.f6434.7

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.7%

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. mult-flipN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{c \cdot \color{blue}{z}} \]
      4. *-commutativeN/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      8. lower-/.f6434.8

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      9. lift-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      10. *-commutativeN/A

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
      11. lift-*.f6434.8

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
    6. Applied rewrites34.8%

      \[\leadsto \frac{1}{c \cdot z} \cdot \color{blue}{b} \]

    if 6.4000000000000002e-52 < z

    1. Initial program 78.8%

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
      3. lower-*.f6437.7

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 13: 49.2% accurate, 1.1× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -0.106:\\ \;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-192}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-268}:\\ \;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{1}{c \cdot z} \cdot b\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -0.106)
   (* (* -4.0 (* a t)) (/ 1.0 c))
   (if (<= z -9e-192)
     (/ (/ b c) z)
     (if (<= z -1e-268)
       (* 9.0 (/ (* x y) (* c z)))
       (if (<= z 6.4e-52) (* (/ 1.0 (* c z)) b) (* -4.0 (/ (* a t) c)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= -9e-192) {
		tmp = (b / c) / z;
	} else if (z <= -1e-268) {
		tmp = 9.0 * ((x * y) / (c * z));
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (z <= (-0.106d0)) then
        tmp = ((-4.0d0) * (a * t)) * (1.0d0 / c)
    else if (z <= (-9d-192)) then
        tmp = (b / c) / z
    else if (z <= (-1d-268)) then
        tmp = 9.0d0 * ((x * y) / (c * z))
    else if (z <= 6.4d-52) then
        tmp = (1.0d0 / (c * z)) * b
    else
        tmp = (-4.0d0) * ((a * t) / c)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= -9e-192) {
		tmp = (b / c) / z;
	} else if (z <= -1e-268) {
		tmp = 9.0 * ((x * y) / (c * z));
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if z <= -0.106:
		tmp = (-4.0 * (a * t)) * (1.0 / c)
	elif z <= -9e-192:
		tmp = (b / c) / z
	elif z <= -1e-268:
		tmp = 9.0 * ((x * y) / (c * z))
	elif z <= 6.4e-52:
		tmp = (1.0 / (c * z)) * b
	else:
		tmp = -4.0 * ((a * t) / c)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -0.106)
		tmp = Float64(Float64(-4.0 * Float64(a * t)) * Float64(1.0 / c));
	elseif (z <= -9e-192)
		tmp = Float64(Float64(b / c) / z);
	elseif (z <= -1e-268)
		tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)));
	elseif (z <= 6.4e-52)
		tmp = Float64(Float64(1.0 / Float64(c * z)) * b);
	else
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (z <= -0.106)
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	elseif (z <= -9e-192)
		tmp = (b / c) / z;
	elseif (z <= -1e-268)
		tmp = 9.0 * ((x * y) / (c * z));
	elseif (z <= 6.4e-52)
		tmp = (1.0 / (c * z)) * b;
	else
		tmp = -4.0 * ((a * t) / c);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -0.106], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-192], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1e-268], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-52], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -0.106:\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\

\mathbf{elif}\;z \leq -9 \cdot 10^{-192}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-268}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\

\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -0.105999999999999997

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \frac{1}{\color{blue}{c}} \]
      4. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \color{blue}{\frac{1}{c}} \]
    8. Applied rewrites86.5%

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
      2. lower-*.f6437.6

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
    11. Applied rewrites37.6%

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

    if -0.105999999999999997 < z < -9.00000000000000048e-192

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]
    5. Step-by-step derivation
      1. lower-/.f6434.4

        \[\leadsto \frac{\frac{b}{\color{blue}{c}}}{z} \]
    6. Applied rewrites34.4%

      \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]

    if -9.00000000000000048e-192 < z < -9.99999999999999958e-269

    1. Initial program 78.8%

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

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

        \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
      3. lower-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
      4. lower-*.f6435.6

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites35.6%

      \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]

    if -9.99999999999999958e-269 < z < 6.4000000000000002e-52

    1. Initial program 78.8%

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

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. lower-*.f6434.7

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.7%

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. mult-flipN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{c \cdot \color{blue}{z}} \]
      4. *-commutativeN/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      8. lower-/.f6434.8

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      9. lift-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      10. *-commutativeN/A

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
      11. lift-*.f6434.8

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
    6. Applied rewrites34.8%

      \[\leadsto \frac{1}{c \cdot z} \cdot \color{blue}{b} \]

    if 6.4000000000000002e-52 < z

    1. Initial program 78.8%

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
      3. lower-*.f6437.7

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 14: 48.7% accurate, 1.5× speedup?

\[\begin{array}{l} \mathbf{if}\;z \leq -0.106:\\ \;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{1}{c \cdot z} \cdot b\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= z -0.106)
   (* (* -4.0 (* a t)) (/ 1.0 c))
   (if (<= z 6.4e-52) (* (/ 1.0 (* c z)) b) (* -4.0 (/ (* a t) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (z <= (-0.106d0)) then
        tmp = ((-4.0d0) * (a * t)) * (1.0d0 / c)
    else if (z <= 6.4d-52) then
        tmp = (1.0d0 / (c * z)) * b
    else
        tmp = (-4.0d0) * ((a * t) / c)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (z <= -0.106) {
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = -4.0 * ((a * t) / c);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if z <= -0.106:
		tmp = (-4.0 * (a * t)) * (1.0 / c)
	elif z <= 6.4e-52:
		tmp = (1.0 / (c * z)) * b
	else:
		tmp = -4.0 * ((a * t) / c)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (z <= -0.106)
		tmp = Float64(Float64(-4.0 * Float64(a * t)) * Float64(1.0 / c));
	elseif (z <= 6.4e-52)
		tmp = Float64(Float64(1.0 / Float64(c * z)) * b);
	else
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (z <= -0.106)
		tmp = (-4.0 * (a * t)) * (1.0 / c);
	elseif (z <= 6.4e-52)
		tmp = (1.0 / (c * z)) * b;
	else
		tmp = -4.0 * ((a * t) / c);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -0.106], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-52], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -0.106:\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\

\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.105999999999999997

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y + \left(\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a - \left(\mathsf{neg}\left(b\right)\right)\right)}}{z \cdot c} \]
      8. div-addN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{9 \cdot x}{c}, \frac{y}{z}, \frac{\mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)}{c \cdot z}\right)} \]
    4. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      5. lower-/.f64N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
      7. lower-/.f6484.3

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right)}{c} \]
    6. Applied rewrites84.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \frac{1}{\color{blue}{c}} \]
      4. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x \cdot y}{z}, \frac{b}{z}\right)\right) \cdot \color{blue}{\frac{1}{c}} \]
    8. Applied rewrites86.5%

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
      2. lower-*.f6437.6

        \[\leadsto \left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c} \]
    11. Applied rewrites37.6%

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

    if -0.105999999999999997 < z < 6.4000000000000002e-52

    1. Initial program 78.8%

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

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. lower-*.f6434.7

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.7%

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. mult-flipN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{c \cdot \color{blue}{z}} \]
      4. *-commutativeN/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      8. lower-/.f6434.8

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      9. lift-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      10. *-commutativeN/A

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
      11. lift-*.f6434.8

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
    6. Applied rewrites34.8%

      \[\leadsto \frac{1}{c \cdot z} \cdot \color{blue}{b} \]

    if 6.4000000000000002e-52 < z

    1. Initial program 78.8%

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
      3. lower-*.f6437.7

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 48.7% accurate, 1.5× speedup?

\[\begin{array}{l} t_1 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;z \leq -0.106:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{1}{c \cdot z} \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* -4.0 (/ (* a t) c))))
   (if (<= z -0.106) t_1 (if (<= z 6.4e-52) (* (/ 1.0 (* c z)) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = -4.0 * ((a * t) / c);
	double tmp;
	if (z <= -0.106) {
		tmp = t_1;
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (-4.0d0) * ((a * t) / c)
    if (z <= (-0.106d0)) then
        tmp = t_1
    else if (z <= 6.4d-52) then
        tmp = (1.0d0 / (c * z)) * b
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = -4.0 * ((a * t) / c);
	double tmp;
	if (z <= -0.106) {
		tmp = t_1;
	} else if (z <= 6.4e-52) {
		tmp = (1.0 / (c * z)) * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = -4.0 * ((a * t) / c)
	tmp = 0
	if z <= -0.106:
		tmp = t_1
	elif z <= 6.4e-52:
		tmp = (1.0 / (c * z)) * b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (z <= -0.106)
		tmp = t_1;
	elseif (z <= 6.4e-52)
		tmp = Float64(Float64(1.0 / Float64(c * z)) * b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (z <= -0.106)
		tmp = t_1;
	elseif (z <= 6.4e-52)
		tmp = (1.0 / (c * z)) * b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.106], t$95$1, If[LessEqual[z, 6.4e-52], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -0.106:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.105999999999999997 or 6.4000000000000002e-52 < z

    1. Initial program 78.8%

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
      3. lower-*.f6437.7

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]

    if -0.105999999999999997 < z < 6.4000000000000002e-52

    1. Initial program 78.8%

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

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. lower-*.f6434.7

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.7%

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. mult-flipN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{c \cdot z}} \]
      3. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{c \cdot \color{blue}{z}} \]
      4. *-commutativeN/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \frac{1}{z \cdot \color{blue}{c}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot \color{blue}{b} \]
      8. lower-/.f6434.8

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      9. lift-*.f64N/A

        \[\leadsto \frac{1}{z \cdot c} \cdot b \]
      10. *-commutativeN/A

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
      11. lift-*.f6434.8

        \[\leadsto \frac{1}{c \cdot z} \cdot b \]
    6. Applied rewrites34.8%

      \[\leadsto \frac{1}{c \cdot z} \cdot \color{blue}{b} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 48.7% accurate, 1.5× speedup?

\[\begin{array}{l} t_1 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;z \leq -0.106:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* -4.0 (/ (* a t) c))))
   (if (<= z -0.106) t_1 (if (<= z 6.4e-52) (/ b (* c z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = -4.0 * ((a * t) / c);
	double tmp;
	if (z <= -0.106) {
		tmp = t_1;
	} else if (z <= 6.4e-52) {
		tmp = b / (c * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (-4.0d0) * ((a * t) / c)
    if (z <= (-0.106d0)) then
        tmp = t_1
    else if (z <= 6.4d-52) then
        tmp = b / (c * z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = -4.0 * ((a * t) / c);
	double tmp;
	if (z <= -0.106) {
		tmp = t_1;
	} else if (z <= 6.4e-52) {
		tmp = b / (c * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = -4.0 * ((a * t) / c)
	tmp = 0
	if z <= -0.106:
		tmp = t_1
	elif z <= 6.4e-52:
		tmp = b / (c * z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (z <= -0.106)
		tmp = t_1;
	elseif (z <= 6.4e-52)
		tmp = Float64(b / Float64(c * z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (z <= -0.106)
		tmp = t_1;
	elseif (z <= 6.4e-52)
		tmp = b / (c * z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.106], t$95$1, If[LessEqual[z, 6.4e-52], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -0.106:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.105999999999999997 or 6.4000000000000002e-52 < z

    1. Initial program 78.8%

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
      3. lower-*.f6437.7

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]

    if -0.105999999999999997 < z < 6.4000000000000002e-52

    1. Initial program 78.8%

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

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
      2. lower-*.f6434.7

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.7%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 34.7% accurate, 3.8× speedup?

\[\frac{b}{c \cdot z} \]
(FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return b / (c * z);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = b / (c * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return b / (c * z);
}
def code(x, y, z, t, a, b, c):
	return b / (c * z)
function code(x, y, z, t, a, b, c)
	return Float64(b / Float64(c * z))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = b / (c * z);
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\frac{b}{c \cdot z}
Derivation
  1. Initial program 78.8%

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

    \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
  3. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
    2. lower-*.f6434.7

      \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
  4. Applied rewrites34.7%

    \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025171 
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, J"
  :precision binary64
  (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))