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

Percentage Accurate: 97.7% → 97.7%
Time: 1.8s
Alternatives: 10
Speedup: 1.2×

Specification

?
\[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
(FPCore (x y z t a b c)
  :precision binary64
  :pre TRUE
  (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
f(x, y, z, t, a, b, c):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf],
	a in [-inf, +inf],
	b in [-inf, +inf],
	c in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t, a, b, c: real): real =
	(((x * y) + ((z * t) / (16))) - ((a * b) / (4))) + c
END code
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 97.7% accurate, 1.0× speedup?

\[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
(FPCore (x y z t a b c)
  :precision binary64
  :pre TRUE
  (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
f(x, y, z, t, a, b, c):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf],
	a in [-inf, +inf],
	b in [-inf, +inf],
	c in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t, a, b, c: real): real =
	(((x * y) + ((z * t) / (16))) - ((a * b) / (4))) + c
END code
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c

Alternative 1: 97.7% accurate, 1.2× speedup?

\[\mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]
(FPCore (x y z t a b c)
  :precision binary64
  :pre TRUE
  (fma (fma (* t z) -0.25 (* b a)) -0.25 (fma y x c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return fma(fma((t * z), -0.25, (b * a)), -0.25, fma(y, x, c));
}
function code(x, y, z, t, a, b, c)
	return fma(fma(Float64(t * z), -0.25, Float64(b * a)), -0.25, fma(y, x, c))
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(t * z), $MachinePrecision] * -0.25 + N[(b * a), $MachinePrecision]), $MachinePrecision] * -0.25 + N[(y * x + c), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t, a, b, c):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf],
	a in [-inf, +inf],
	b in [-inf, +inf],
	c in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t, a, b, c: real): real =
	((((t * z) * (-25e-2)) + (b * a)) * (-25e-2)) + ((y * x) + c)
END code
\mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, \mathsf{fma}\left(y, x, c\right)\right)
Derivation
  1. Initial program 97.7%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. Applied rewrites97.7%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]
    2. Add Preprocessing

    Alternative 2: 89.2% accurate, 0.8× speedup?

    \[\begin{array}{l} \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\ \end{array} \]
    (FPCore (x y z t a b c)
      :precision binary64
      :pre TRUE
      (if (<= (* x y) -4e+134)
      (fma (* a b) -0.25 (fma y x c))
      (if (<= (* x y) 5e+59)
        (fma (fma (* t z) -0.25 (* b a)) -0.25 c)
        (fma (* 0.0625 z) t (fma y x c)))))
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double tmp;
    	if ((x * y) <= -4e+134) {
    		tmp = fma((a * b), -0.25, fma(y, x, c));
    	} else if ((x * y) <= 5e+59) {
    		tmp = fma(fma((t * z), -0.25, (b * a)), -0.25, c);
    	} else {
    		tmp = fma((0.0625 * z), t, fma(y, x, c));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c)
    	tmp = 0.0
    	if (Float64(x * y) <= -4e+134)
    		tmp = fma(Float64(a * b), -0.25, fma(y, x, c));
    	elseif (Float64(x * y) <= 5e+59)
    		tmp = fma(fma(Float64(t * z), -0.25, Float64(b * a)), -0.25, c);
    	else
    		tmp = fma(Float64(0.0625 * z), t, fma(y, x, c));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e+134], N[(N[(a * b), $MachinePrecision] * -0.25 + N[(y * x + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+59], N[(N[(N[(t * z), $MachinePrecision] * -0.25 + N[(b * a), $MachinePrecision]), $MachinePrecision] * -0.25 + c), $MachinePrecision], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision]]]
    
    f(x, y, z, t, a, b, c):
    	x in [-inf, +inf],
    	y in [-inf, +inf],
    	z in [-inf, +inf],
    	t in [-inf, +inf],
    	a in [-inf, +inf],
    	b in [-inf, +inf],
    	c in [-inf, +inf]
    code: THEORY
    BEGIN
    f(x, y, z, t, a, b, c: real): real =
    	LET tmp_1 = IF ((x * y) <= (499999999999999974693567648537009433481822505506705036541952)) THEN (((((t * z) * (-25e-2)) + (b * a)) * (-25e-2)) + c) ELSE ((((625e-4) * z) * t) + ((y * x) + c)) ENDIF IN
    	LET tmp = IF ((x * y) <= (-399999999999999968592814598682797260030199309491889846017500444199393206430641297891429046460580357712197457831351381962129679723790336)) THEN (((a * b) * (-25e-2)) + ((y * x) + c)) ELSE tmp_1 ENDIF IN
    	tmp
    END code
    \begin{array}{l}
    \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+134}:\\
    \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right)\\
    
    \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59}:\\
    \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 x y) < -3.9999999999999997e134

      1. Initial program 97.7%

        \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
      2. Step-by-step derivation
        1. Applied rewrites97.7%

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

          \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]
        3. Step-by-step derivation
          1. Applied rewrites73.7%

            \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]

          if -3.9999999999999997e134 < (*.f64 x y) < 4.9999999999999997e59

          1. Initial program 97.7%

            \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
          2. Step-by-step derivation
            1. Applied rewrites97.7%

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
            3. Step-by-step derivation
              1. Applied rewrites74.0%

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

              if 4.9999999999999997e59 < (*.f64 x y)

              1. Initial program 97.7%

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

                \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
              3. Step-by-step derivation
                1. Applied rewrites72.9%

                  \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                2. Applied rewrites73.4%

                  \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
              4. Recombined 3 regimes into one program.
              5. Add Preprocessing

              Alternative 3: 89.2% accurate, 0.9× speedup?

              \[\begin{array}{l} t_1 := \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right)\\ \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\ \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
              (FPCore (x y z t a b c)
                :precision binary64
                :pre TRUE
                (let* ((t_1 (fma (* a b) -0.25 (fma y x c))))
                (if (<= (* a b) -1.5414268888085725e+44)
                  t_1
                  (if (<= (* a b) 1766690827.541296)
                    (fma (* 0.0625 z) t (fma y x c))
                    t_1))))
              double code(double x, double y, double z, double t, double a, double b, double c) {
              	double t_1 = fma((a * b), -0.25, fma(y, x, c));
              	double tmp;
              	if ((a * b) <= -1.5414268888085725e+44) {
              		tmp = t_1;
              	} else if ((a * b) <= 1766690827.541296) {
              		tmp = fma((0.0625 * z), t, fma(y, x, c));
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b, c)
              	t_1 = fma(Float64(a * b), -0.25, fma(y, x, c))
              	tmp = 0.0
              	if (Float64(a * b) <= -1.5414268888085725e+44)
              		tmp = t_1;
              	elseif (Float64(a * b) <= 1766690827.541296)
              		tmp = fma(Float64(0.0625 * z), t, fma(y, x, c));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25 + N[(y * x + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.5414268888085725e+44], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1766690827.541296], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
              
              f(x, y, z, t, a, b, c):
              	x in [-inf, +inf],
              	y in [-inf, +inf],
              	z in [-inf, +inf],
              	t in [-inf, +inf],
              	a in [-inf, +inf],
              	b in [-inf, +inf],
              	c in [-inf, +inf]
              code: THEORY
              BEGIN
              f(x, y, z, t, a, b, c: real): real =
              	LET t_1 = (((a * b) * (-25e-2)) + ((y * x) + c)) IN
              		LET tmp_1 = IF ((a * b) <= (17666908275412960052490234375e-19)) THEN ((((625e-4) * z) * t) + ((y * x) + c)) ELSE t_1 ENDIF IN
              		LET tmp = IF ((a * b) <= (-154142688880857253015249070331368326419185664)) THEN t_1 ELSE tmp_1 ENDIF IN
              	tmp
              END code
              \begin{array}{l}
              t_1 := \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right)\\
              \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\
              \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 a b) < -1.5414268888085725e44 or 1766690827.541296 < (*.f64 a b)

                1. Initial program 97.7%

                  \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                2. Step-by-step derivation
                  1. Applied rewrites97.7%

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

                    \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites73.7%

                      \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]

                    if -1.5414268888085725e44 < (*.f64 a b) < 1766690827.541296

                    1. Initial program 97.7%

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

                      \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites72.9%

                        \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                      2. Applied rewrites73.4%

                        \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 4: 86.1% accurate, 0.9× speedup?

                    \[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -6.113484582340225 \cdot 10^{+147}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, c\right)\\ \mathbf{elif}\;a \cdot b \leq 1.5070441306524407 \cdot 10^{+65}:\\ \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, x \cdot y\right)\\ \end{array} \]
                    (FPCore (x y z t a b c)
                      :precision binary64
                      :pre TRUE
                      (if (<= (* a b) -6.113484582340225e+147)
                      (fma (* a b) -0.25 c)
                      (if (<= (* a b) 1.5070441306524407e+65)
                        (fma (* 0.0625 z) t (fma y x c))
                        (fma (* a b) -0.25 (* x y)))))
                    double code(double x, double y, double z, double t, double a, double b, double c) {
                    	double tmp;
                    	if ((a * b) <= -6.113484582340225e+147) {
                    		tmp = fma((a * b), -0.25, c);
                    	} else if ((a * b) <= 1.5070441306524407e+65) {
                    		tmp = fma((0.0625 * z), t, fma(y, x, c));
                    	} else {
                    		tmp = fma((a * b), -0.25, (x * y));
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t, a, b, c)
                    	tmp = 0.0
                    	if (Float64(a * b) <= -6.113484582340225e+147)
                    		tmp = fma(Float64(a * b), -0.25, c);
                    	elseif (Float64(a * b) <= 1.5070441306524407e+65)
                    		tmp = fma(Float64(0.0625 * z), t, fma(y, x, c));
                    	else
                    		tmp = fma(Float64(a * b), -0.25, Float64(x * y));
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -6.113484582340225e+147], N[(N[(a * b), $MachinePrecision] * -0.25 + c), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.5070441306524407e+65], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * -0.25 + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
                    
                    f(x, y, z, t, a, b, c):
                    	x in [-inf, +inf],
                    	y in [-inf, +inf],
                    	z in [-inf, +inf],
                    	t in [-inf, +inf],
                    	a in [-inf, +inf],
                    	b in [-inf, +inf],
                    	c in [-inf, +inf]
                    code: THEORY
                    BEGIN
                    f(x, y, z, t, a, b, c: real): real =
                    	LET tmp_1 = IF ((a * b) <= (150704413065244067728363383409005260300575989330546438268036055040)) THEN ((((625e-4) * z) * t) + ((y * x) + c)) ELSE (((a * b) * (-25e-2)) + (x * y)) ENDIF IN
                    	LET tmp = IF ((a * b) <= (-6113484582340225114390863045446215144041674693067911482818513430441622931783418051058031799825177560164563247997174162910212413505938552196970840064)) THEN (((a * b) * (-25e-2)) + c) ELSE tmp_1 ENDIF IN
                    	tmp
                    END code
                    \begin{array}{l}
                    \mathbf{if}\;a \cdot b \leq -6.113484582340225 \cdot 10^{+147}:\\
                    \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, c\right)\\
                    
                    \mathbf{elif}\;a \cdot b \leq 1.5070441306524407 \cdot 10^{+65}:\\
                    \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, x \cdot y\right)\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (*.f64 a b) < -6.1134845823402251e147

                      1. Initial program 97.7%

                        \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                      2. Step-by-step derivation
                        1. Applied rewrites97.7%

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

                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites74.0%

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                          2. Taylor expanded in z around 0

                            \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites49.1%

                              \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]

                            if -6.1134845823402251e147 < (*.f64 a b) < 1.5070441306524407e65

                            1. Initial program 97.7%

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

                              \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites72.9%

                                \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                              2. Applied rewrites73.4%

                                \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]

                              if 1.5070441306524407e65 < (*.f64 a b)

                              1. Initial program 97.7%

                                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                              2. Step-by-step derivation
                                1. Applied rewrites97.7%

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

                                  \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites73.7%

                                    \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, \mathsf{fma}\left(y, x, c\right)\right) \]
                                  2. Taylor expanded in x around inf

                                    \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, x \cdot y\right) \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites53.4%

                                      \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, x \cdot y\right) \]
                                  4. Recombined 3 regimes into one program.
                                  5. Add Preprocessing

                                  Alternative 5: 77.7% accurate, 0.6× speedup?

                                  \[\begin{array}{l} t_1 := \mathsf{fma}\left(0.0625 \cdot z, t, x \cdot y\right)\\ t_2 := x \cdot y + \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+103}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
                                  (FPCore (x y z t a b c)
                                    :precision binary64
                                    :pre TRUE
                                    (let* ((t_1 (fma (* 0.0625 z) t (* x y)))
                                         (t_2 (+ (* x y) (/ (* z t) 16.0))))
                                    (if (<= t_2 -5e+177)
                                      t_1
                                      (if (<= t_2 5e+103) (fma (* a b) -0.25 c) t_1))))
                                  double code(double x, double y, double z, double t, double a, double b, double c) {
                                  	double t_1 = fma((0.0625 * z), t, (x * y));
                                  	double t_2 = (x * y) + ((z * t) / 16.0);
                                  	double tmp;
                                  	if (t_2 <= -5e+177) {
                                  		tmp = t_1;
                                  	} else if (t_2 <= 5e+103) {
                                  		tmp = fma((a * b), -0.25, c);
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(x, y, z, t, a, b, c)
                                  	t_1 = fma(Float64(0.0625 * z), t, Float64(x * y))
                                  	t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0))
                                  	tmp = 0.0
                                  	if (t_2 <= -5e+177)
                                  		tmp = t_1;
                                  	elseif (t_2 <= 5e+103)
                                  		tmp = fma(Float64(a * b), -0.25, c);
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(0.0625 * z), $MachinePrecision] * t + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+177], t$95$1, If[LessEqual[t$95$2, 5e+103], N[(N[(a * b), $MachinePrecision] * -0.25 + c), $MachinePrecision], t$95$1]]]]
                                  
                                  f(x, y, z, t, a, b, c):
                                  	x in [-inf, +inf],
                                  	y in [-inf, +inf],
                                  	z in [-inf, +inf],
                                  	t in [-inf, +inf],
                                  	a in [-inf, +inf],
                                  	b in [-inf, +inf],
                                  	c in [-inf, +inf]
                                  code: THEORY
                                  BEGIN
                                  f(x, y, z, t, a, b, c: real): real =
                                  	LET t_1 = ((((625e-4) * z) * t) + (x * y)) IN
                                  		LET t_2 = ((x * y) + ((z * t) / (16))) IN
                                  			LET tmp_1 = IF (t_2 <= (50000000000000000095783754286733436810797756363259600557640175729968966210199437798061807255409016176640)) THEN (((a * b) * (-25e-2)) + c) ELSE t_1 ENDIF IN
                                  			LET tmp = IF (t_2 <= (-5000000000000000262190592237531418597736900077214862305283068621659030917376859431910478415443928807994362318208466088914672700840093622075866148980296178635908453530060388827136)) THEN t_1 ELSE tmp_1 ENDIF IN
                                  	tmp
                                  END code
                                  \begin{array}{l}
                                  t_1 := \mathsf{fma}\left(0.0625 \cdot z, t, x \cdot y\right)\\
                                  t_2 := x \cdot y + \frac{z \cdot t}{16}\\
                                  \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+177}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+103}:\\
                                  \;\;\;\;\mathsf{fma}\left(a \cdot b, -0.25, c\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -5.0000000000000003e177 or 5e103 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64)))

                                    1. Initial program 97.7%

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

                                      \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites72.9%

                                        \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                      2. Applied rewrites73.4%

                                        \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                      3. Taylor expanded in x around inf

                                        \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, x \cdot y\right) \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites53.0%

                                          \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, x \cdot y\right) \]

                                        if -5.0000000000000003e177 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 5e103

                                        1. Initial program 97.7%

                                          \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites97.7%

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

                                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites74.0%

                                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                                            2. Taylor expanded in z around 0

                                              \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites49.1%

                                                \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]
                                            4. Recombined 2 regimes into one program.
                                            5. Add Preprocessing

                                            Alternative 6: 64.8% accurate, 1.1× speedup?

                                            \[\begin{array}{l} t_1 := \mathsf{fma}\left(a \cdot b, -0.25, c\right)\\ \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\ \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
                                            (FPCore (x y z t a b c)
                                              :precision binary64
                                              :pre TRUE
                                              (let* ((t_1 (fma (* a b) -0.25 c)))
                                              (if (<= (* a b) -1.5414268888085725e+44)
                                                t_1
                                                (if (<= (* a b) 1766690827.541296) (fma (* 0.0625 z) t c) t_1))))
                                            double code(double x, double y, double z, double t, double a, double b, double c) {
                                            	double t_1 = fma((a * b), -0.25, c);
                                            	double tmp;
                                            	if ((a * b) <= -1.5414268888085725e+44) {
                                            		tmp = t_1;
                                            	} else if ((a * b) <= 1766690827.541296) {
                                            		tmp = fma((0.0625 * z), t, c);
                                            	} else {
                                            		tmp = t_1;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a, b, c)
                                            	t_1 = fma(Float64(a * b), -0.25, c)
                                            	tmp = 0.0
                                            	if (Float64(a * b) <= -1.5414268888085725e+44)
                                            		tmp = t_1;
                                            	elseif (Float64(a * b) <= 1766690827.541296)
                                            		tmp = fma(Float64(0.0625 * z), t, c);
                                            	else
                                            		tmp = t_1;
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25 + c), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.5414268888085725e+44], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1766690827.541296], N[(N[(0.0625 * z), $MachinePrecision] * t + c), $MachinePrecision], t$95$1]]]
                                            
                                            f(x, y, z, t, a, b, c):
                                            	x in [-inf, +inf],
                                            	y in [-inf, +inf],
                                            	z in [-inf, +inf],
                                            	t in [-inf, +inf],
                                            	a in [-inf, +inf],
                                            	b in [-inf, +inf],
                                            	c in [-inf, +inf]
                                            code: THEORY
                                            BEGIN
                                            f(x, y, z, t, a, b, c: real): real =
                                            	LET t_1 = (((a * b) * (-25e-2)) + c) IN
                                            		LET tmp_1 = IF ((a * b) <= (17666908275412960052490234375e-19)) THEN ((((625e-4) * z) * t) + c) ELSE t_1 ENDIF IN
                                            		LET tmp = IF ((a * b) <= (-154142688880857253015249070331368326419185664)) THEN t_1 ELSE tmp_1 ENDIF IN
                                            	tmp
                                            END code
                                            \begin{array}{l}
                                            t_1 := \mathsf{fma}\left(a \cdot b, -0.25, c\right)\\
                                            \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\
                                            \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if (*.f64 a b) < -1.5414268888085725e44 or 1766690827.541296 < (*.f64 a b)

                                              1. Initial program 97.7%

                                                \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites97.7%

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

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites74.0%

                                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                                                  2. Taylor expanded in z around 0

                                                    \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites49.1%

                                                      \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]

                                                    if -1.5414268888085725e44 < (*.f64 a b) < 1766690827.541296

                                                    1. Initial program 97.7%

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

                                                      \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites72.9%

                                                        \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                      2. Applied rewrites73.4%

                                                        \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                                      3. Taylor expanded in x around 0

                                                        \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, c\right) \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites48.3%

                                                          \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, c\right) \]
                                                      5. Recombined 2 regimes into one program.
                                                      6. Add Preprocessing

                                                      Alternative 7: 64.8% accurate, 1.1× speedup?

                                                      \[\begin{array}{l} t_1 := \mathsf{fma}\left(a \cdot b, -0.25, c\right)\\ \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
                                                      (FPCore (x y z t a b c)
                                                        :precision binary64
                                                        :pre TRUE
                                                        (let* ((t_1 (fma (* a b) -0.25 c)))
                                                        (if (<= (* a b) -1.5414268888085725e+44)
                                                          t_1
                                                          (if (<= (* a b) 1766690827.541296) (+ c (* 0.0625 (* t z))) t_1))))
                                                      double code(double x, double y, double z, double t, double a, double b, double c) {
                                                      	double t_1 = fma((a * b), -0.25, c);
                                                      	double tmp;
                                                      	if ((a * b) <= -1.5414268888085725e+44) {
                                                      		tmp = t_1;
                                                      	} else if ((a * b) <= 1766690827.541296) {
                                                      		tmp = c + (0.0625 * (t * z));
                                                      	} else {
                                                      		tmp = t_1;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      function code(x, y, z, t, a, b, c)
                                                      	t_1 = fma(Float64(a * b), -0.25, c)
                                                      	tmp = 0.0
                                                      	if (Float64(a * b) <= -1.5414268888085725e+44)
                                                      		tmp = t_1;
                                                      	elseif (Float64(a * b) <= 1766690827.541296)
                                                      		tmp = Float64(c + Float64(0.0625 * Float64(t * z)));
                                                      	else
                                                      		tmp = t_1;
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25 + c), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.5414268888085725e+44], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1766690827.541296], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                                      
                                                      f(x, y, z, t, a, b, c):
                                                      	x in [-inf, +inf],
                                                      	y in [-inf, +inf],
                                                      	z in [-inf, +inf],
                                                      	t in [-inf, +inf],
                                                      	a in [-inf, +inf],
                                                      	b in [-inf, +inf],
                                                      	c in [-inf, +inf]
                                                      code: THEORY
                                                      BEGIN
                                                      f(x, y, z, t, a, b, c: real): real =
                                                      	LET t_1 = (((a * b) * (-25e-2)) + c) IN
                                                      		LET tmp_1 = IF ((a * b) <= (17666908275412960052490234375e-19)) THEN (c + ((625e-4) * (t * z))) ELSE t_1 ENDIF IN
                                                      		LET tmp = IF ((a * b) <= (-154142688880857253015249070331368326419185664)) THEN t_1 ELSE tmp_1 ENDIF IN
                                                      	tmp
                                                      END code
                                                      \begin{array}{l}
                                                      t_1 := \mathsf{fma}\left(a \cdot b, -0.25, c\right)\\
                                                      \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\
                                                      \;\;\;\;t\_1\\
                                                      
                                                      \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\
                                                      \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;t\_1\\
                                                      
                                                      
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if (*.f64 a b) < -1.5414268888085725e44 or 1766690827.541296 < (*.f64 a b)

                                                        1. Initial program 97.7%

                                                          \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites97.7%

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

                                                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites74.0%

                                                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, -0.25, b \cdot a\right), -0.25, c\right) \]
                                                            2. Taylor expanded in z around 0

                                                              \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites49.1%

                                                                \[\leadsto \mathsf{fma}\left(a \cdot b, -0.25, c\right) \]

                                                              if -1.5414268888085725e44 < (*.f64 a b) < 1766690827.541296

                                                              1. Initial program 97.7%

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

                                                                \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites72.9%

                                                                  \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                                2. Taylor expanded in x around 0

                                                                  \[\leadsto c + \frac{1}{16} \cdot \left(t \cdot z\right) \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites48.2%

                                                                    \[\leadsto c + 0.0625 \cdot \left(t \cdot z\right) \]
                                                                4. Recombined 2 regimes into one program.
                                                                5. Add Preprocessing

                                                                Alternative 8: 62.8% accurate, 1.1× speedup?

                                                                \[\begin{array}{l} t_1 := -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \cdot b \leq -6.113484582340225 \cdot 10^{+147}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 2.0022127870946247 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
                                                                (FPCore (x y z t a b c)
                                                                  :precision binary64
                                                                  :pre TRUE
                                                                  (let* ((t_1 (* -0.25 (* a b))))
                                                                  (if (<= (* a b) -6.113484582340225e+147)
                                                                    t_1
                                                                    (if (<= (* a b) 2.0022127870946247e+68)
                                                                      (fma (* 0.0625 z) t c)
                                                                      t_1))))
                                                                double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                	double t_1 = -0.25 * (a * b);
                                                                	double tmp;
                                                                	if ((a * b) <= -6.113484582340225e+147) {
                                                                		tmp = t_1;
                                                                	} else if ((a * b) <= 2.0022127870946247e+68) {
                                                                		tmp = fma((0.0625 * z), t, c);
                                                                	} else {
                                                                		tmp = t_1;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                function code(x, y, z, t, a, b, c)
                                                                	t_1 = Float64(-0.25 * Float64(a * b))
                                                                	tmp = 0.0
                                                                	if (Float64(a * b) <= -6.113484582340225e+147)
                                                                		tmp = t_1;
                                                                	elseif (Float64(a * b) <= 2.0022127870946247e+68)
                                                                		tmp = fma(Float64(0.0625 * z), t, c);
                                                                	else
                                                                		tmp = t_1;
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -6.113484582340225e+147], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2.0022127870946247e+68], N[(N[(0.0625 * z), $MachinePrecision] * t + c), $MachinePrecision], t$95$1]]]
                                                                
                                                                f(x, y, z, t, a, b, c):
                                                                	x in [-inf, +inf],
                                                                	y in [-inf, +inf],
                                                                	z in [-inf, +inf],
                                                                	t in [-inf, +inf],
                                                                	a in [-inf, +inf],
                                                                	b in [-inf, +inf],
                                                                	c in [-inf, +inf]
                                                                code: THEORY
                                                                BEGIN
                                                                f(x, y, z, t, a, b, c: real): real =
                                                                	LET t_1 = ((-25e-2) * (a * b)) IN
                                                                		LET tmp_1 = IF ((a * b) <= (200221278709462465866775332606168549858544853579378552827786519642112)) THEN ((((625e-4) * z) * t) + c) ELSE t_1 ENDIF IN
                                                                		LET tmp = IF ((a * b) <= (-6113484582340225114390863045446215144041674693067911482818513430441622931783418051058031799825177560164563247997174162910212413505938552196970840064)) THEN t_1 ELSE tmp_1 ENDIF IN
                                                                	tmp
                                                                END code
                                                                \begin{array}{l}
                                                                t_1 := -0.25 \cdot \left(a \cdot b\right)\\
                                                                \mathbf{if}\;a \cdot b \leq -6.113484582340225 \cdot 10^{+147}:\\
                                                                \;\;\;\;t\_1\\
                                                                
                                                                \mathbf{elif}\;a \cdot b \leq 2.0022127870946247 \cdot 10^{+68}:\\
                                                                \;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;t\_1\\
                                                                
                                                                
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if (*.f64 a b) < -6.1134845823402251e147 or 2.0022127870946247e68 < (*.f64 a b)

                                                                  1. Initial program 97.7%

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

                                                                    \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites72.9%

                                                                      \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                                    2. Applied rewrites73.4%

                                                                      \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                                                    3. Taylor expanded in a around inf

                                                                      \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) \]
                                                                    4. Step-by-step derivation
                                                                      1. Applied rewrites29.0%

                                                                        \[\leadsto -0.25 \cdot \left(a \cdot b\right) \]

                                                                      if -6.1134845823402251e147 < (*.f64 a b) < 2.0022127870946247e68

                                                                      1. Initial program 97.7%

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

                                                                        \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites72.9%

                                                                          \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                                        2. Applied rewrites73.4%

                                                                          \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                                                        3. Taylor expanded in x around 0

                                                                          \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, c\right) \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites48.3%

                                                                            \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, c\right) \]
                                                                        5. Recombined 2 regimes into one program.
                                                                        6. Add Preprocessing

                                                                        Alternative 9: 44.5% accurate, 1.2× speedup?

                                                                        \[\begin{array}{l} t_1 := -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
                                                                        (FPCore (x y z t a b c)
                                                                          :precision binary64
                                                                          :pre TRUE
                                                                          (let* ((t_1 (* -0.25 (* a b))))
                                                                          (if (<= (* a b) -1.5414268888085725e+44)
                                                                            t_1
                                                                            (if (<= (* a b) 1766690827.541296) (* 0.0625 (* t z)) t_1))))
                                                                        double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                        	double t_1 = -0.25 * (a * b);
                                                                        	double tmp;
                                                                        	if ((a * b) <= -1.5414268888085725e+44) {
                                                                        		tmp = t_1;
                                                                        	} else if ((a * b) <= 1766690827.541296) {
                                                                        		tmp = 0.0625 * (t * z);
                                                                        	} else {
                                                                        		tmp = t_1;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        real(8) function code(x, y, z, t, a, b, c)
                                                                        use fmin_fmax_functions
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            real(8), intent (in) :: z
                                                                            real(8), intent (in) :: t
                                                                            real(8), intent (in) :: a
                                                                            real(8), intent (in) :: b
                                                                            real(8), intent (in) :: c
                                                                            real(8) :: t_1
                                                                            real(8) :: tmp
                                                                            t_1 = (-0.25d0) * (a * b)
                                                                            if ((a * b) <= (-1.5414268888085725d+44)) then
                                                                                tmp = t_1
                                                                            else if ((a * b) <= 1766690827.541296d0) then
                                                                                tmp = 0.0625d0 * (t * z)
                                                                            else
                                                                                tmp = t_1
                                                                            end if
                                                                            code = tmp
                                                                        end function
                                                                        
                                                                        public static double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                        	double t_1 = -0.25 * (a * b);
                                                                        	double tmp;
                                                                        	if ((a * b) <= -1.5414268888085725e+44) {
                                                                        		tmp = t_1;
                                                                        	} else if ((a * b) <= 1766690827.541296) {
                                                                        		tmp = 0.0625 * (t * z);
                                                                        	} else {
                                                                        		tmp = t_1;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x, y, z, t, a, b, c):
                                                                        	t_1 = -0.25 * (a * b)
                                                                        	tmp = 0
                                                                        	if (a * b) <= -1.5414268888085725e+44:
                                                                        		tmp = t_1
                                                                        	elif (a * b) <= 1766690827.541296:
                                                                        		tmp = 0.0625 * (t * z)
                                                                        	else:
                                                                        		tmp = t_1
                                                                        	return tmp
                                                                        
                                                                        function code(x, y, z, t, a, b, c)
                                                                        	t_1 = Float64(-0.25 * Float64(a * b))
                                                                        	tmp = 0.0
                                                                        	if (Float64(a * b) <= -1.5414268888085725e+44)
                                                                        		tmp = t_1;
                                                                        	elseif (Float64(a * b) <= 1766690827.541296)
                                                                        		tmp = Float64(0.0625 * Float64(t * z));
                                                                        	else
                                                                        		tmp = t_1;
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(x, y, z, t, a, b, c)
                                                                        	t_1 = -0.25 * (a * b);
                                                                        	tmp = 0.0;
                                                                        	if ((a * b) <= -1.5414268888085725e+44)
                                                                        		tmp = t_1;
                                                                        	elseif ((a * b) <= 1766690827.541296)
                                                                        		tmp = 0.0625 * (t * z);
                                                                        	else
                                                                        		tmp = t_1;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.5414268888085725e+44], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1766690827.541296], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                                                        
                                                                        f(x, y, z, t, a, b, c):
                                                                        	x in [-inf, +inf],
                                                                        	y in [-inf, +inf],
                                                                        	z in [-inf, +inf],
                                                                        	t in [-inf, +inf],
                                                                        	a in [-inf, +inf],
                                                                        	b in [-inf, +inf],
                                                                        	c in [-inf, +inf]
                                                                        code: THEORY
                                                                        BEGIN
                                                                        f(x, y, z, t, a, b, c: real): real =
                                                                        	LET t_1 = ((-25e-2) * (a * b)) IN
                                                                        		LET tmp_1 = IF ((a * b) <= (17666908275412960052490234375e-19)) THEN ((625e-4) * (t * z)) ELSE t_1 ENDIF IN
                                                                        		LET tmp = IF ((a * b) <= (-154142688880857253015249070331368326419185664)) THEN t_1 ELSE tmp_1 ENDIF IN
                                                                        	tmp
                                                                        END code
                                                                        \begin{array}{l}
                                                                        t_1 := -0.25 \cdot \left(a \cdot b\right)\\
                                                                        \mathbf{if}\;a \cdot b \leq -1.5414268888085725 \cdot 10^{+44}:\\
                                                                        \;\;\;\;t\_1\\
                                                                        
                                                                        \mathbf{elif}\;a \cdot b \leq 1766690827.541296:\\
                                                                        \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t\_1\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if (*.f64 a b) < -1.5414268888085725e44 or 1766690827.541296 < (*.f64 a b)

                                                                          1. Initial program 97.7%

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

                                                                            \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites72.9%

                                                                              \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                                            2. Applied rewrites73.4%

                                                                              \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                                                            3. Taylor expanded in a around inf

                                                                              \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) \]
                                                                            4. Step-by-step derivation
                                                                              1. Applied rewrites29.0%

                                                                                \[\leadsto -0.25 \cdot \left(a \cdot b\right) \]

                                                                              if -1.5414268888085725e44 < (*.f64 a b) < 1766690827.541296

                                                                              1. Initial program 97.7%

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

                                                                                \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites72.9%

                                                                                  \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                                                2. Applied rewrites73.4%

                                                                                  \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                                                                3. Taylor expanded in a around inf

                                                                                  \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites29.0%

                                                                                    \[\leadsto -0.25 \cdot \left(a \cdot b\right) \]
                                                                                  2. Taylor expanded in z around inf

                                                                                    \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites28.1%

                                                                                      \[\leadsto 0.0625 \cdot \left(t \cdot z\right) \]
                                                                                  4. Recombined 2 regimes into one program.
                                                                                  5. Add Preprocessing

                                                                                  Alternative 10: 29.0% accurate, 3.6× speedup?

                                                                                  \[-0.25 \cdot \left(a \cdot b\right) \]
                                                                                  (FPCore (x y z t a b c)
                                                                                    :precision binary64
                                                                                    :pre TRUE
                                                                                    (* -0.25 (* a b)))
                                                                                  double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                  	return -0.25 * (a * b);
                                                                                  }
                                                                                  
                                                                                  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 = (-0.25d0) * (a * b)
                                                                                  end function
                                                                                  
                                                                                  public static double code(double x, double y, double z, double t, double a, double b, double c) {
                                                                                  	return -0.25 * (a * b);
                                                                                  }
                                                                                  
                                                                                  def code(x, y, z, t, a, b, c):
                                                                                  	return -0.25 * (a * b)
                                                                                  
                                                                                  function code(x, y, z, t, a, b, c)
                                                                                  	return Float64(-0.25 * Float64(a * b))
                                                                                  end
                                                                                  
                                                                                  function tmp = code(x, y, z, t, a, b, c)
                                                                                  	tmp = -0.25 * (a * b);
                                                                                  end
                                                                                  
                                                                                  code[x_, y_, z_, t_, a_, b_, c_] := N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]
                                                                                  
                                                                                  f(x, y, z, t, a, b, c):
                                                                                  	x in [-inf, +inf],
                                                                                  	y in [-inf, +inf],
                                                                                  	z in [-inf, +inf],
                                                                                  	t in [-inf, +inf],
                                                                                  	a in [-inf, +inf],
                                                                                  	b in [-inf, +inf],
                                                                                  	c in [-inf, +inf]
                                                                                  code: THEORY
                                                                                  BEGIN
                                                                                  f(x, y, z, t, a, b, c: real): real =
                                                                                  	(-25e-2) * (a * b)
                                                                                  END code
                                                                                  -0.25 \cdot \left(a \cdot b\right)
                                                                                  
                                                                                  Derivation
                                                                                  1. Initial program 97.7%

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

                                                                                    \[\leadsto c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right) \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites72.9%

                                                                                      \[\leadsto c + \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right) \]
                                                                                    2. Applied rewrites73.4%

                                                                                      \[\leadsto \mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right) \]
                                                                                    3. Taylor expanded in a around inf

                                                                                      \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) \]
                                                                                    4. Step-by-step derivation
                                                                                      1. Applied rewrites29.0%

                                                                                        \[\leadsto -0.25 \cdot \left(a \cdot b\right) \]
                                                                                      2. Add Preprocessing

                                                                                      Reproduce

                                                                                      ?
                                                                                      herbie shell --seed 2026092 
                                                                                      (FPCore (x y z t a b c)
                                                                                        :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, C"
                                                                                        :precision binary64
                                                                                        (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))