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

Percentage Accurate: 97.6% → 98.7%
Time: 12.1s
Alternatives: 13
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* 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)
    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]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* 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)
    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]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}

Alternative 1: 98.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right) + \left(c + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY)
   (+ (fma t (* z 0.0625) (* a (* b -0.25))) (+ c (* x y)))
   (fma x y (+ c (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
		tmp = fma(t, (z * 0.0625), (a * (b * -0.25))) + (c + (x * y));
	} else {
		tmp = fma(x, y, (c + (0.0625 * (z * t))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf)
		tmp = Float64(fma(t, Float64(z * 0.0625), Float64(a * Float64(b * -0.25))) + Float64(c + Float64(x * y)));
	else
		tmp = fma(x, y, Float64(c + Float64(0.0625 * Float64(z * t))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(t * N[(z * 0.0625), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y + N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right) + \left(c + x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. sub-neg100.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*99.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. associate--r-99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right) + x \cdot y\right)} + c \]
      7. associate-+l+100.0%

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

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

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4))

    1. Initial program 0.0%

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

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+0.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/28.6%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. neg-sub028.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{0 - \left(\frac{a \cdot b}{4} - c\right)}\right)\right) \]
      7. associate-+l-28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(0 - \frac{a \cdot b}{4}\right) + c}\right)\right) \]
      8. neg-sub028.6%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/28.6%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-128.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{a \cdot -1}}{4}, b, c\right)\right)\right) \]
      15. associate-/l*28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval28.6%

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + 0.0625 \cdot \left(t \cdot z\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right) + \left(c + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \]

Alternative 2: 98.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c)
	return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c)))
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Derivation
  1. Initial program 97.2%

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

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
    2. associate--l+97.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
    4. associate-*l/98.0%

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
    6. neg-sub098.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{0 - \left(\frac{a \cdot b}{4} - c\right)}\right)\right) \]
    7. associate-+l-98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(0 - \frac{a \cdot b}{4}\right) + c}\right)\right) \]
    8. neg-sub098.0%

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

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
    10. distribute-frac-neg98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
    11. associate-/r/98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
    12. fma-def98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
    13. neg-mul-198.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
    14. *-commutative98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{a \cdot -1}}{4}, b, c\right)\right)\right) \]
    15. associate-/l*98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
    16. metadata-eval98.0%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
  4. Final simplification98.0%

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

Alternative 3: 98.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;c + t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
   (if (<= t_1 INFINITY) (+ c t_1) (fma x y (+ c (* 0.0625 (* z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = c + t_1;
	} else {
		tmp = fma(x, y, (c + (0.0625 * (z * t))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(c + t_1);
	else
		tmp = fma(x, y, Float64(c + Float64(0.0625 * Float64(z * t))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(x * y + N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4))

    1. Initial program 0.0%

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

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+0.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/28.6%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. neg-sub028.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{0 - \left(\frac{a \cdot b}{4} - c\right)}\right)\right) \]
      7. associate-+l-28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(0 - \frac{a \cdot b}{4}\right) + c}\right)\right) \]
      8. neg-sub028.6%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/28.6%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-128.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{a \cdot -1}}{4}, b, c\right)\right)\right) \]
      15. associate-/l*28.6%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval28.6%

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + 0.0625 \cdot \left(t \cdot z\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \]

Alternative 4: 98.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;c + t_1\\ \mathbf{else}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
   (if (<= t_1 INFINITY) (+ c t_1) (+ c (* z (* t 0.0625))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = c + t_1;
	} else {
		tmp = c + (z * (t * 0.0625));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = c + t_1;
	} else {
		tmp = c + (z * (t * 0.0625));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)
	tmp = 0
	if t_1 <= math.inf:
		tmp = c + t_1
	else:
		tmp = c + (z * (t * 0.0625))
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(c + t_1);
	else
		tmp = Float64(c + Float64(z * Float64(t * 0.0625)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = c + t_1;
	else
		tmp = c + (z * (t * 0.0625));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\

\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4))

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*73.5%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. *-commutative73.5%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z + c \]
      3. *-commutative73.5%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative73.5%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    4. Simplified73.5%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} + c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \]

Alternative 5: 89.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;x \cdot y \leq -3.3 \cdot 10^{+60}:\\ \;\;\;\;\left(c + x \cdot y\right) - t_1\\ \mathbf{elif}\;x \cdot y \leq 0.8:\\ \;\;\;\;\left(c + t_2\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + t_2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
   (if (<= (* x y) -3.3e+60)
     (- (+ c (* x y)) t_1)
     (if (<= (* x y) 0.8) (- (+ c t_2) t_1) (+ c (+ (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if ((x * y) <= -3.3e+60) {
		tmp = (c + (x * y)) - t_1;
	} else if ((x * y) <= 0.8) {
		tmp = (c + t_2) - t_1;
	} else {
		tmp = c + ((x * y) + t_2);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) * 0.25d0
    t_2 = 0.0625d0 * (z * t)
    if ((x * y) <= (-3.3d+60)) then
        tmp = (c + (x * y)) - t_1
    else if ((x * y) <= 0.8d0) then
        tmp = (c + t_2) - t_1
    else
        tmp = c + ((x * y) + t_2)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if ((x * y) <= -3.3e+60) {
		tmp = (c + (x * y)) - t_1;
	} else if ((x * y) <= 0.8) {
		tmp = (c + t_2) - t_1;
	} else {
		tmp = c + ((x * y) + t_2);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	t_2 = 0.0625 * (z * t)
	tmp = 0
	if (x * y) <= -3.3e+60:
		tmp = (c + (x * y)) - t_1
	elif (x * y) <= 0.8:
		tmp = (c + t_2) - t_1
	else:
		tmp = c + ((x * y) + t_2)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * 0.25)
	t_2 = Float64(0.0625 * Float64(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -3.3e+60)
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	elseif (Float64(x * y) <= 0.8)
		tmp = Float64(Float64(c + t_2) - t_1);
	else
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	t_2 = 0.0625 * (z * t);
	tmp = 0.0;
	if ((x * y) <= -3.3e+60)
		tmp = (c + (x * y)) - t_1;
	elseif ((x * y) <= 0.8)
		tmp = (c + t_2) - t_1;
	else
		tmp = c + ((x * y) + t_2);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.3e+60], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.8], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -3.3 \cdot 10^{+60}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\

\mathbf{elif}\;x \cdot y \leq 0.8:\\
\;\;\;\;\left(c + t_2\right) - t_1\\

\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\


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

    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. associate-+l-97.7%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. sub-neg97.7%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{\frac{16}{t}}}\right) - \left(\frac{a \cdot b}{4} + \left(-c\right)\right) \]
      5. sub-neg97.7%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*97.7%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
    3. Simplified97.7%

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

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

    if -3.2999999999999998e60 < (*.f64 x y) < 0.80000000000000004

    1. Initial program 98.6%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{\frac{16}{t}}}\right) - \left(\frac{a \cdot b}{4} + \left(-c\right)\right) \]
      5. sub-neg98.5%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*98.4%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
    3. Simplified98.4%

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]

    if 0.80000000000000004 < (*.f64 x y)

    1. Initial program 94.2%

      \[\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 88.8%

      \[\leadsto \color{blue}{\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} + c \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.3 \cdot 10^{+60}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 0.8:\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \]

Alternative 6: 61.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{+88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-287}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-138}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+49}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (* x y) (* (* a b) 0.25))) (t_2 (+ c (* z (* t 0.0625)))))
   (if (<= z -5.4e+88)
     t_2
     (if (<= z -3.5e-74)
       t_1
       (if (<= z -1.04e-287)
         (+ c (* b (* a -0.25)))
         (if (<= z 1.3e-138) (+ c (* x y)) (if (<= z 2.7e+49) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double t_2 = c + (z * (t * 0.0625));
	double tmp;
	if (z <= -5.4e+88) {
		tmp = t_2;
	} else if (z <= -3.5e-74) {
		tmp = t_1;
	} else if (z <= -1.04e-287) {
		tmp = c + (b * (a * -0.25));
	} else if (z <= 1.3e-138) {
		tmp = c + (x * y);
	} else if (z <= 2.7e+49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * y) - ((a * b) * 0.25d0)
    t_2 = c + (z * (t * 0.0625d0))
    if (z <= (-5.4d+88)) then
        tmp = t_2
    else if (z <= (-3.5d-74)) then
        tmp = t_1
    else if (z <= (-1.04d-287)) then
        tmp = c + (b * (a * (-0.25d0)))
    else if (z <= 1.3d-138) then
        tmp = c + (x * y)
    else if (z <= 2.7d+49) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double t_2 = c + (z * (t * 0.0625));
	double tmp;
	if (z <= -5.4e+88) {
		tmp = t_2;
	} else if (z <= -3.5e-74) {
		tmp = t_1;
	} else if (z <= -1.04e-287) {
		tmp = c + (b * (a * -0.25));
	} else if (z <= 1.3e-138) {
		tmp = c + (x * y);
	} else if (z <= 2.7e+49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) - ((a * b) * 0.25)
	t_2 = c + (z * (t * 0.0625))
	tmp = 0
	if z <= -5.4e+88:
		tmp = t_2
	elif z <= -3.5e-74:
		tmp = t_1
	elif z <= -1.04e-287:
		tmp = c + (b * (a * -0.25))
	elif z <= 1.3e-138:
		tmp = c + (x * y)
	elif z <= 2.7e+49:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))
	t_2 = Float64(c + Float64(z * Float64(t * 0.0625)))
	tmp = 0.0
	if (z <= -5.4e+88)
		tmp = t_2;
	elseif (z <= -3.5e-74)
		tmp = t_1;
	elseif (z <= -1.04e-287)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (z <= 1.3e-138)
		tmp = Float64(c + Float64(x * y));
	elseif (z <= 2.7e+49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * y) - ((a * b) * 0.25);
	t_2 = c + (z * (t * 0.0625));
	tmp = 0.0;
	if (z <= -5.4e+88)
		tmp = t_2;
	elseif (z <= -3.5e-74)
		tmp = t_1;
	elseif (z <= -1.04e-287)
		tmp = c + (b * (a * -0.25));
	elseif (z <= 1.3e-138)
		tmp = c + (x * y);
	elseif (z <= 2.7e+49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+88], t$95$2, If[LessEqual[z, -3.5e-74], t$95$1, If[LessEqual[z, -1.04e-287], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-138], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+49], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+88}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-74}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.04 \cdot 10^{-287}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-138}:\\
\;\;\;\;c + x \cdot y\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.40000000000000031e88 or 2.7000000000000001e49 < z

    1. Initial program 95.4%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*67.6%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. *-commutative67.6%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z + c \]
      3. *-commutative67.6%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative67.6%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    4. Simplified67.6%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} + c \]

    if -5.40000000000000031e88 < z < -3.50000000000000015e-74 or 1.3e-138 < z < 2.7000000000000001e49

    1. Initial program 97.1%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{\frac{16}{t}}}\right) - \left(\frac{a \cdot b}{4} + \left(-c\right)\right) \]
      5. sub-neg97.0%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*96.9%

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

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

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Taylor expanded in c around 0 58.4%

      \[\leadsto \color{blue}{x \cdot y - 0.25 \cdot \left(a \cdot b\right)} \]

    if -3.50000000000000015e-74 < z < -1.03999999999999996e-287

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*84.9%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative84.9%

        \[\leadsto \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c \]
      3. *-commutative84.9%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
    4. Simplified84.9%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]

    if -1.03999999999999996e-287 < z < 1.3e-138

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+88}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-74}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-287}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-138}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+49}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \]

Alternative 7: 86.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+186}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{+214}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* a b) -2.5e+186)
   (+ c (* b (* a -0.25)))
   (if (<= (* a b) 1e+214)
     (+ c (+ (* x y) (* 0.0625 (* z t))))
     (- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a * b) <= -2.5e+186) {
		tmp = c + (b * (a * -0.25));
	} else if ((a * b) <= 1e+214) {
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	} else {
		tmp = (x * y) - ((a * b) * 0.25);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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 ((a * b) <= (-2.5d+186)) then
        tmp = c + (b * (a * (-0.25d0)))
    else if ((a * b) <= 1d+214) then
        tmp = c + ((x * y) + (0.0625d0 * (z * t)))
    else
        tmp = (x * y) - ((a * b) * 0.25d0)
    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 ((a * b) <= -2.5e+186) {
		tmp = c + (b * (a * -0.25));
	} else if ((a * b) <= 1e+214) {
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	} else {
		tmp = (x * y) - ((a * b) * 0.25);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (a * b) <= -2.5e+186:
		tmp = c + (b * (a * -0.25))
	elif (a * b) <= 1e+214:
		tmp = c + ((x * y) + (0.0625 * (z * t)))
	else:
		tmp = (x * y) - ((a * b) * 0.25)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(a * b) <= -2.5e+186)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (Float64(a * b) <= 1e+214)
		tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))));
	else
		tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((a * b) <= -2.5e+186)
		tmp = c + (b * (a * -0.25));
	elseif ((a * b) <= 1e+214)
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	else
		tmp = (x * y) - ((a * b) * 0.25);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.5e+186], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+214], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+186}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;a \cdot b \leq 10^{+214}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -2.49999999999999977e186

    1. Initial program 89.1%

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

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*79.5%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative79.5%

        \[\leadsto \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c \]
      3. *-commutative79.5%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
    4. Simplified79.5%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]

    if -2.49999999999999977e186 < (*.f64 a b) < 9.9999999999999995e213

    1. Initial program 99.4%

      \[\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 91.2%

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

    if 9.9999999999999995e213 < (*.f64 a b)

    1. Initial program 95.0%

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

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. sub-neg95.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*94.8%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
    3. Simplified94.8%

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

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Taylor expanded in c around 0 80.3%

      \[\leadsto \color{blue}{x \cdot y - 0.25 \cdot \left(a \cdot b\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+186}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{+214}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]

Alternative 8: 60.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{+129}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{-287}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+49}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y))) (t_2 (+ c (* z (* t 0.0625)))))
   (if (<= z -4.4e+129)
     t_2
     (if (<= z -1.02e-82)
       t_1
       (if (<= z -1.22e-287)
         (+ c (* b (* a -0.25)))
         (if (<= z 2.1e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = c + (z * (t * 0.0625));
	double tmp;
	if (z <= -4.4e+129) {
		tmp = t_2;
	} else if (z <= -1.02e-82) {
		tmp = t_1;
	} else if (z <= -1.22e-287) {
		tmp = c + (b * (a * -0.25));
	} else if (z <= 2.1e+49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = c + (z * (t * 0.0625d0))
    if (z <= (-4.4d+129)) then
        tmp = t_2
    else if (z <= (-1.02d-82)) then
        tmp = t_1
    else if (z <= (-1.22d-287)) then
        tmp = c + (b * (a * (-0.25d0)))
    else if (z <= 2.1d+49) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = c + (z * (t * 0.0625));
	double tmp;
	if (z <= -4.4e+129) {
		tmp = t_2;
	} else if (z <= -1.02e-82) {
		tmp = t_1;
	} else if (z <= -1.22e-287) {
		tmp = c + (b * (a * -0.25));
	} else if (z <= 2.1e+49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = c + (z * (t * 0.0625))
	tmp = 0
	if z <= -4.4e+129:
		tmp = t_2
	elif z <= -1.02e-82:
		tmp = t_1
	elif z <= -1.22e-287:
		tmp = c + (b * (a * -0.25))
	elif z <= 2.1e+49:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(c + Float64(z * Float64(t * 0.0625)))
	tmp = 0.0
	if (z <= -4.4e+129)
		tmp = t_2;
	elseif (z <= -1.02e-82)
		tmp = t_1;
	elseif (z <= -1.22e-287)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (z <= 2.1e+49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = c + (z * (t * 0.0625));
	tmp = 0.0;
	if (z <= -4.4e+129)
		tmp = t_2;
	elseif (z <= -1.02e-82)
		tmp = t_1;
	elseif (z <= -1.22e-287)
		tmp = c + (b * (a * -0.25));
	elseif (z <= 2.1e+49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+129], t$95$2, If[LessEqual[z, -1.02e-82], t$95$1, If[LessEqual[z, -1.22e-287], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+129}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-82}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.22 \cdot 10^{-287}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.3999999999999999e129 or 2.10000000000000011e49 < z

    1. Initial program 95.1%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*67.3%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. *-commutative67.3%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z + c \]
      3. *-commutative67.3%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative67.3%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    4. Simplified67.3%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} + c \]

    if -4.3999999999999999e129 < z < -1.02000000000000007e-82 or -1.21999999999999996e-287 < z < 2.10000000000000011e49

    1. Initial program 98.2%

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

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

    if -1.02000000000000007e-82 < z < -1.21999999999999996e-287

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*86.0%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative86.0%

        \[\leadsto \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c \]
      3. *-commutative86.0%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
    4. Simplified86.0%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+129}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-82}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{-287}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+49}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \]

Alternative 9: 64.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+100} \lor \neg \left(x \cdot y \leq 5.2 \cdot 10^{+22}\right):\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= (* x y) -9.6e+100) (not (<= (* x y) 5.2e+22)))
   (+ c (* x y))
   (+ c (* b (* a -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((x * y) <= -9.6e+100) || !((x * y) <= 5.2e+22)) {
		tmp = c + (x * y);
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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 (((x * y) <= (-9.6d+100)) .or. (.not. ((x * y) <= 5.2d+22))) then
        tmp = c + (x * y)
    else
        tmp = c + (b * (a * (-0.25d0)))
    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 (((x * y) <= -9.6e+100) || !((x * y) <= 5.2e+22)) {
		tmp = c + (x * y);
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if ((x * y) <= -9.6e+100) or not ((x * y) <= 5.2e+22):
		tmp = c + (x * y)
	else:
		tmp = c + (b * (a * -0.25))
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((Float64(x * y) <= -9.6e+100) || !(Float64(x * y) <= 5.2e+22))
		tmp = Float64(c + Float64(x * y));
	else
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (((x * y) <= -9.6e+100) || ~(((x * y) <= 5.2e+22)))
		tmp = c + (x * y);
	else
		tmp = c + (b * (a * -0.25));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -9.6e+100], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.2e+22]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+100} \lor \neg \left(x \cdot y \leq 5.2 \cdot 10^{+22}\right):\\
\;\;\;\;c + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.60000000000000046e100 or 5.2e22 < (*.f64 x y)

    1. Initial program 96.0%

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

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

    if -9.60000000000000046e100 < (*.f64 x y) < 5.2e22

    1. Initial program 98.0%

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

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    3. Step-by-step derivation
      1. associate-*r*61.8%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative61.8%

        \[\leadsto \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c \]
      3. *-commutative61.8%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
    4. Simplified61.8%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+100} \lor \neg \left(x \cdot y \leq 5.2 \cdot 10^{+22}\right):\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]

Alternative 10: 84.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+70} \lor \neg \left(z \leq 10^{-50}\right):\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= z -1e+70) (not (<= z 1e-50)))
   (+ c (+ (* x y) (* 0.0625 (* z t))))
   (- (+ c (* x y)) (* (* a b) 0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((z <= -1e+70) || !(z <= 1e-50)) {
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	} else {
		tmp = (c + (x * y)) - ((a * b) * 0.25);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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 <= (-1d+70)) .or. (.not. (z <= 1d-50))) then
        tmp = c + ((x * y) + (0.0625d0 * (z * t)))
    else
        tmp = (c + (x * y)) - ((a * b) * 0.25d0)
    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 <= -1e+70) || !(z <= 1e-50)) {
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	} else {
		tmp = (c + (x * y)) - ((a * b) * 0.25);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (z <= -1e+70) or not (z <= 1e-50):
		tmp = c + ((x * y) + (0.0625 * (z * t)))
	else:
		tmp = (c + (x * y)) - ((a * b) * 0.25)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((z <= -1e+70) || !(z <= 1e-50))
		tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))));
	else
		tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((z <= -1e+70) || ~((z <= 1e-50)))
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	else
		tmp = (c + (x * y)) - ((a * b) * 0.25);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1e+70], N[Not[LessEqual[z, 1e-50]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+70} \lor \neg \left(z \leq 10^{-50}\right):\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.00000000000000007e70 or 1.00000000000000001e-50 < z

    1. Initial program 96.4%

      \[\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 85.8%

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

    if -1.00000000000000007e70 < z < 1.00000000000000001e-50

    1. Initial program 98.3%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
    3. Simplified98.1%

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

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+70} \lor \neg \left(z \leq 10^{-50}\right):\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]

Alternative 11: 42.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+100}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+98}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* x y) -9.6e+100) (* x y) (if (<= (* x y) 4.5e+98) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((x * y) <= -9.6e+100) {
		tmp = x * y;
	} else if ((x * y) <= 4.5e+98) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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 ((x * y) <= (-9.6d+100)) then
        tmp = x * y
    else if ((x * y) <= 4.5d+98) then
        tmp = c
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((x * y) <= -9.6e+100) {
		tmp = x * y;
	} else if ((x * y) <= 4.5e+98) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (x * y) <= -9.6e+100:
		tmp = x * y
	elif (x * y) <= 4.5e+98:
		tmp = c
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(x * y) <= -9.6e+100)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 4.5e+98)
		tmp = c;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((x * y) <= -9.6e+100)
		tmp = x * y;
	elseif ((x * y) <= 4.5e+98)
		tmp = c;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -9.6e+100], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.5e+98], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+100}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+98}:\\
\;\;\;\;c\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.60000000000000046e100 or 4.5000000000000002e98 < (*.f64 x y)

    1. Initial program 95.4%

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

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. sub-neg95.4%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{\frac{16}{t}}}\right) - \left(\frac{a \cdot b}{4} + \left(-c\right)\right) \]
      5. sub-neg96.5%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*96.5%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
    3. Simplified96.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. associate--r-96.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right) + x \cdot y\right)} + c \]
      7. associate-+l+95.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right) + \left(x \cdot y + c\right)} \]
    6. Taylor expanded in x around inf 67.4%

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

    if -9.60000000000000046e100 < (*.f64 x y) < 4.5000000000000002e98

    1. Initial program 98.2%

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

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. sub-neg98.2%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{\frac{16}{t}}}\right) - \left(\frac{a \cdot b}{4} + \left(-c\right)\right) \]
      5. sub-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
      6. associate-/l*98.0%

        \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
    3. Simplified98.0%

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

      \[\leadsto \color{blue}{c} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+100}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+98}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 12: 49.1% accurate, 3.4× speedup?

\[\begin{array}{l} \\ c + x \cdot y \end{array} \]
(FPCore (x y z t a b c) :precision binary64 (+ c (* x y)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c + (x * y);
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = c + (x * y)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c + (x * y);
}
def code(x, y, z, t, a, b, c):
	return c + (x * y)
function code(x, y, z, t, a, b, c)
	return Float64(c + Float64(x * y))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = c + (x * y);
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c + x \cdot y
\end{array}
Derivation
  1. Initial program 97.2%

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

    \[\leadsto \color{blue}{x \cdot y} + c \]
  3. Final simplification48.5%

    \[\leadsto c + x \cdot y \]

Alternative 13: 22.4% accurate, 17.0× speedup?

\[\begin{array}{l} \\ c \end{array} \]
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
def code(x, y, z, t, a, b, c):
	return c
function code(x, y, z, t, a, b, c)
	return c
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = c;
end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}

\\
c
\end{array}
Derivation
  1. Initial program 97.2%

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

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
    2. sub-neg97.2%

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{\frac{16}{t}}}\right) - \left(\frac{a \cdot b}{4} + \left(-c\right)\right) \]
    5. sub-neg97.6%

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \color{blue}{\left(\frac{a \cdot b}{4} - c\right)} \]
    6. associate-/l*97.5%

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \left(\color{blue}{\frac{a}{\frac{4}{b}}} - c\right) \]
  3. Simplified97.5%

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

    \[\leadsto \color{blue}{c} \]
  5. Final simplification23.3%

    \[\leadsto c \]

Reproduce

?
herbie shell --seed 2023297 
(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))