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

Percentage Accurate: 97.8% → 99.0%
Time: 9.1s
Alternatives: 16
Speedup: 1.0×

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 16 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.8% 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: 99.0% 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 98.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-98.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+98.0%

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

      \[\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.4%

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

      \[\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. sub-neg99.2%

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

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

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

      \[\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-neg99.2%

      \[\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/99.2%

      \[\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-def99.2%

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

      \[\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. *-commutative99.2%

      \[\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*99.2%

      \[\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-eval99.2%

      \[\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. Simplified99.2%

    \[\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 simplification99.2%

    \[\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 2: 98.3% accurate, 0.1× speedup?

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

\\
x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot -0.25, b, c\right)\right)
\end{array}
Derivation
  1. Initial program 98.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-98.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+98.0%

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

      \[\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.4%

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

      \[\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. sub-neg99.2%

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

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

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

      \[\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-neg99.2%

      \[\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/99.2%

      \[\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-def99.2%

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

      \[\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. *-commutative99.2%

      \[\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*99.2%

      \[\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-eval99.2%

      \[\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. Simplified99.2%

    \[\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. Step-by-step derivation
    1. fma-udef98.4%

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

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

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

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

      \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
  5. Applied egg-rr98.4%

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

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

Alternative 3: 98.2% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Derivation
  1. Initial program 98.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-98.0%

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

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

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

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

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

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

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

Alternative 4: 57.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \cdot b \leq -3.8 \cdot 10^{+47}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq -5.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -1.25 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 4.2 \cdot 10^{-185}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{-85}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 1.32 \cdot 10^{-15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 3.6 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* z t))) (t_3 (* -0.25 (* a b))))
   (if (<= (* a b) -3.8e+47)
     t_3
     (if (<= (* a b) -5.5)
       t_1
       (if (<= (* a b) -1.25e-109)
         t_2
         (if (<= (* a b) 4.2e-185)
           t_1
           (if (<= (* a b) 1.3e-85)
             t_2
             (if (<= (* a b) 2.7e-43)
               t_1
               (if (<= (* a b) 1.32e-15)
                 t_2
                 (if (<= (* a b) 3.6e+84) t_1 t_3))))))))))
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 = 0.0625 * (z * t);
	double t_3 = -0.25 * (a * b);
	double tmp;
	if ((a * b) <= -3.8e+47) {
		tmp = t_3;
	} else if ((a * b) <= -5.5) {
		tmp = t_1;
	} else if ((a * b) <= -1.25e-109) {
		tmp = t_2;
	} else if ((a * b) <= 4.2e-185) {
		tmp = t_1;
	} else if ((a * b) <= 1.3e-85) {
		tmp = t_2;
	} else if ((a * b) <= 2.7e-43) {
		tmp = t_1;
	} else if ((a * b) <= 1.32e-15) {
		tmp = t_2;
	} else if ((a * b) <= 3.6e+84) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = 0.0625d0 * (z * t)
    t_3 = (-0.25d0) * (a * b)
    if ((a * b) <= (-3.8d+47)) then
        tmp = t_3
    else if ((a * b) <= (-5.5d0)) then
        tmp = t_1
    else if ((a * b) <= (-1.25d-109)) then
        tmp = t_2
    else if ((a * b) <= 4.2d-185) then
        tmp = t_1
    else if ((a * b) <= 1.3d-85) then
        tmp = t_2
    else if ((a * b) <= 2.7d-43) then
        tmp = t_1
    else if ((a * b) <= 1.32d-15) then
        tmp = t_2
    else if ((a * b) <= 3.6d+84) then
        tmp = t_1
    else
        tmp = t_3
    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 = 0.0625 * (z * t);
	double t_3 = -0.25 * (a * b);
	double tmp;
	if ((a * b) <= -3.8e+47) {
		tmp = t_3;
	} else if ((a * b) <= -5.5) {
		tmp = t_1;
	} else if ((a * b) <= -1.25e-109) {
		tmp = t_2;
	} else if ((a * b) <= 4.2e-185) {
		tmp = t_1;
	} else if ((a * b) <= 1.3e-85) {
		tmp = t_2;
	} else if ((a * b) <= 2.7e-43) {
		tmp = t_1;
	} else if ((a * b) <= 1.32e-15) {
		tmp = t_2;
	} else if ((a * b) <= 3.6e+84) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = 0.0625 * (z * t)
	t_3 = -0.25 * (a * b)
	tmp = 0
	if (a * b) <= -3.8e+47:
		tmp = t_3
	elif (a * b) <= -5.5:
		tmp = t_1
	elif (a * b) <= -1.25e-109:
		tmp = t_2
	elif (a * b) <= 4.2e-185:
		tmp = t_1
	elif (a * b) <= 1.3e-85:
		tmp = t_2
	elif (a * b) <= 2.7e-43:
		tmp = t_1
	elif (a * b) <= 1.32e-15:
		tmp = t_2
	elif (a * b) <= 3.6e+84:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(0.0625 * Float64(z * t))
	t_3 = Float64(-0.25 * Float64(a * b))
	tmp = 0.0
	if (Float64(a * b) <= -3.8e+47)
		tmp = t_3;
	elseif (Float64(a * b) <= -5.5)
		tmp = t_1;
	elseif (Float64(a * b) <= -1.25e-109)
		tmp = t_2;
	elseif (Float64(a * b) <= 4.2e-185)
		tmp = t_1;
	elseif (Float64(a * b) <= 1.3e-85)
		tmp = t_2;
	elseif (Float64(a * b) <= 2.7e-43)
		tmp = t_1;
	elseif (Float64(a * b) <= 1.32e-15)
		tmp = t_2;
	elseif (Float64(a * b) <= 3.6e+84)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = 0.0625 * (z * t);
	t_3 = -0.25 * (a * b);
	tmp = 0.0;
	if ((a * b) <= -3.8e+47)
		tmp = t_3;
	elseif ((a * b) <= -5.5)
		tmp = t_1;
	elseif ((a * b) <= -1.25e-109)
		tmp = t_2;
	elseif ((a * b) <= 4.2e-185)
		tmp = t_1;
	elseif ((a * b) <= 1.3e-85)
		tmp = t_2;
	elseif ((a * b) <= 2.7e-43)
		tmp = t_1;
	elseif ((a * b) <= 1.32e-15)
		tmp = t_2;
	elseif ((a * b) <= 3.6e+84)
		tmp = t_1;
	else
		tmp = t_3;
	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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.8e+47], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -5.5], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.25e-109], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 4.2e-185], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.3e-85], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2.7e-43], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.32e-15], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.6e+84], t$95$1, t$95$3]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -5.5:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -1.25 \cdot 10^{-109}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \cdot b \leq 4.2 \cdot 10^{-185}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{-85}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{-43}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq 1.32 \cdot 10^{-15}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \cdot b \leq 3.6 \cdot 10^{+84}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -3.8000000000000003e47 or 3.5999999999999999e84 < (*.f64 a b)

    1. Initial program 96.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-96.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+96.2%

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

        \[\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/96.2%

        \[\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.1%

        \[\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. sub-neg98.1%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\frac{a \cdot b}{4}\right) + \color{blue}{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.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

      \[\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. Step-by-step derivation
      1. fma-udef97.2%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr97.2%

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

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

    if -3.8000000000000003e47 < (*.f64 a b) < -5.5 or -1.25000000000000005e-109 < (*.f64 a b) < 4.2e-185 or 1.30000000000000006e-85 < (*.f64 a b) < 2.69999999999999991e-43 or 1.31999999999999995e-15 < (*.f64 a b) < 3.5999999999999999e84

    1. Initial program 99.1%

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

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

    if -5.5 < (*.f64 a b) < -1.25000000000000005e-109 or 4.2e-185 < (*.f64 a b) < 1.30000000000000006e-85 or 2.69999999999999991e-43 < (*.f64 a b) < 1.31999999999999995e-15

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.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/100.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-neg100.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. sub-neg100.0%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\frac{a \cdot b}{4}\right) + \color{blue}{c}\right)\right) \]
      9. associate-/l*100.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-neg100.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/100.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-def100.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-1100.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. *-commutative100.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*100.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-eval100.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. Simplified100.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. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.8 \cdot 10^{+47}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq -5.5:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -1.25 \cdot 10^{-109}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 4.2 \cdot 10^{-185}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{-85}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{-43}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.32 \cdot 10^{-15}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 3.6 \cdot 10^{+84}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 5: 65.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + t_1\\ t_3 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -3.05 \cdot 10^{+87}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{-294}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq 0.028:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+166}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))) (t_2 (+ c t_1)) (t_3 (+ c (* b (* a -0.25)))))
   (if (<= (* x y) -3.05e+87)
     (+ c (* x y))
     (if (<= (* x y) 9.2e-294)
       t_2
       (if (<= (* x y) 2.1e-69)
         t_3
         (if (<= (* x y) 0.028)
           t_2
           (if (<= (* x y) 5e+166) t_3 (+ (* x y) t_1))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double t_2 = c + t_1;
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -3.05e+87) {
		tmp = c + (x * y);
	} else if ((x * y) <= 9.2e-294) {
		tmp = t_2;
	} else if ((x * y) <= 2.1e-69) {
		tmp = t_3;
	} else if ((x * y) <= 0.028) {
		tmp = t_2;
	} else if ((x * y) <= 5e+166) {
		tmp = t_3;
	} else {
		tmp = (x * y) + t_1;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = 0.0625d0 * (z * t)
    t_2 = c + t_1
    t_3 = c + (b * (a * (-0.25d0)))
    if ((x * y) <= (-3.05d+87)) then
        tmp = c + (x * y)
    else if ((x * y) <= 9.2d-294) then
        tmp = t_2
    else if ((x * y) <= 2.1d-69) then
        tmp = t_3
    else if ((x * y) <= 0.028d0) then
        tmp = t_2
    else if ((x * y) <= 5d+166) then
        tmp = t_3
    else
        tmp = (x * y) + 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.0625 * (z * t);
	double t_2 = c + t_1;
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -3.05e+87) {
		tmp = c + (x * y);
	} else if ((x * y) <= 9.2e-294) {
		tmp = t_2;
	} else if ((x * y) <= 2.1e-69) {
		tmp = t_3;
	} else if ((x * y) <= 0.028) {
		tmp = t_2;
	} else if ((x * y) <= 5e+166) {
		tmp = t_3;
	} else {
		tmp = (x * y) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	t_2 = c + t_1
	t_3 = c + (b * (a * -0.25))
	tmp = 0
	if (x * y) <= -3.05e+87:
		tmp = c + (x * y)
	elif (x * y) <= 9.2e-294:
		tmp = t_2
	elif (x * y) <= 2.1e-69:
		tmp = t_3
	elif (x * y) <= 0.028:
		tmp = t_2
	elif (x * y) <= 5e+166:
		tmp = t_3
	else:
		tmp = (x * y) + t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	t_2 = Float64(c + t_1)
	t_3 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (Float64(x * y) <= -3.05e+87)
		tmp = Float64(c + Float64(x * y));
	elseif (Float64(x * y) <= 9.2e-294)
		tmp = t_2;
	elseif (Float64(x * y) <= 2.1e-69)
		tmp = t_3;
	elseif (Float64(x * y) <= 0.028)
		tmp = t_2;
	elseif (Float64(x * y) <= 5e+166)
		tmp = t_3;
	else
		tmp = Float64(Float64(x * y) + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (z * t);
	t_2 = c + t_1;
	t_3 = c + (b * (a * -0.25));
	tmp = 0.0;
	if ((x * y) <= -3.05e+87)
		tmp = c + (x * y);
	elseif ((x * y) <= 9.2e-294)
		tmp = t_2;
	elseif ((x * y) <= 2.1e-69)
		tmp = t_3;
	elseif ((x * y) <= 0.028)
		tmp = t_2;
	elseif ((x * y) <= 5e+166)
		tmp = t_3;
	else
		tmp = (x * y) + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.05e+87], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.2e-294], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.1e-69], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 0.028], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e+166], t$95$3, N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{-294}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{-69}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \cdot y \leq 0.028:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+166}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -3.0499999999999999e87

    1. Initial program 95.3%

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

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

    if -3.0499999999999999e87 < (*.f64 x y) < 9.20000000000000064e-294 or 2.1e-69 < (*.f64 x y) < 0.0280000000000000006

    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 z around inf 71.3%

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

    if 9.20000000000000064e-294 < (*.f64 x y) < 2.1e-69 or 0.0280000000000000006 < (*.f64 x y) < 5.0000000000000002e166

    1. Initial program 98.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 inf 70.0%

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

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

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

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

    if 5.0000000000000002e166 < (*.f64 x y)

    1. Initial program 93.5%

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

      \[\leadsto \color{blue}{\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} + c \]
    3. Taylor expanded in c around 0 84.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.05 \cdot 10^{+87}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{-294}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 0.028:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+166}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 6: 88.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := \left(a \cdot b\right) \cdot 0.25\\ t_3 := \left(c + t_1\right) - t_2\\ t_4 := c + \left(x \cdot y + t_1\right)\\ \mathbf{if}\;x \cdot y \leq -2.65 \cdot 10^{+91}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+35}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{+122}:\\ \;\;\;\;\left(c + x \cdot y\right) - t_2\\ \mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{+160}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t)))
        (t_2 (* (* a b) 0.25))
        (t_3 (- (+ c t_1) t_2))
        (t_4 (+ c (+ (* x y) t_1))))
   (if (<= (* x y) -2.65e+91)
     t_4
     (if (<= (* x y) 6.5e+35)
       t_3
       (if (<= (* x y) 1.7e+122)
         (- (+ c (* x y)) t_2)
         (if (<= (* x y) 1.85e+160) t_3 t_4))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double t_2 = (a * b) * 0.25;
	double t_3 = (c + t_1) - t_2;
	double t_4 = c + ((x * y) + t_1);
	double tmp;
	if ((x * y) <= -2.65e+91) {
		tmp = t_4;
	} else if ((x * y) <= 6.5e+35) {
		tmp = t_3;
	} else if ((x * y) <= 1.7e+122) {
		tmp = (c + (x * y)) - t_2;
	} else if ((x * y) <= 1.85e+160) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = 0.0625d0 * (z * t)
    t_2 = (a * b) * 0.25d0
    t_3 = (c + t_1) - t_2
    t_4 = c + ((x * y) + t_1)
    if ((x * y) <= (-2.65d+91)) then
        tmp = t_4
    else if ((x * y) <= 6.5d+35) then
        tmp = t_3
    else if ((x * y) <= 1.7d+122) then
        tmp = (c + (x * y)) - t_2
    else if ((x * y) <= 1.85d+160) then
        tmp = t_3
    else
        tmp = t_4
    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.0625 * (z * t);
	double t_2 = (a * b) * 0.25;
	double t_3 = (c + t_1) - t_2;
	double t_4 = c + ((x * y) + t_1);
	double tmp;
	if ((x * y) <= -2.65e+91) {
		tmp = t_4;
	} else if ((x * y) <= 6.5e+35) {
		tmp = t_3;
	} else if ((x * y) <= 1.7e+122) {
		tmp = (c + (x * y)) - t_2;
	} else if ((x * y) <= 1.85e+160) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	t_2 = (a * b) * 0.25
	t_3 = (c + t_1) - t_2
	t_4 = c + ((x * y) + t_1)
	tmp = 0
	if (x * y) <= -2.65e+91:
		tmp = t_4
	elif (x * y) <= 6.5e+35:
		tmp = t_3
	elif (x * y) <= 1.7e+122:
		tmp = (c + (x * y)) - t_2
	elif (x * y) <= 1.85e+160:
		tmp = t_3
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	t_2 = Float64(Float64(a * b) * 0.25)
	t_3 = Float64(Float64(c + t_1) - t_2)
	t_4 = Float64(c + Float64(Float64(x * y) + t_1))
	tmp = 0.0
	if (Float64(x * y) <= -2.65e+91)
		tmp = t_4;
	elseif (Float64(x * y) <= 6.5e+35)
		tmp = t_3;
	elseif (Float64(x * y) <= 1.7e+122)
		tmp = Float64(Float64(c + Float64(x * y)) - t_2);
	elseif (Float64(x * y) <= 1.85e+160)
		tmp = t_3;
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (z * t);
	t_2 = (a * b) * 0.25;
	t_3 = (c + t_1) - t_2;
	t_4 = c + ((x * y) + t_1);
	tmp = 0.0;
	if ((x * y) <= -2.65e+91)
		tmp = t_4;
	elseif ((x * y) <= 6.5e+35)
		tmp = t_3;
	elseif ((x * y) <= 1.7e+122)
		tmp = (c + (x * y)) - t_2;
	elseif ((x * y) <= 1.85e+160)
		tmp = t_3;
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.65e+91], t$95$4, If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+35], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 1.7e+122], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.85e+160], t$95$3, t$95$4]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+35}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{+122}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_2\\

\mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{+160}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_4\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.64999999999999998e91 or 1.85000000000000008e160 < (*.f64 x y)

    1. Initial program 94.6%

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

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

    if -2.64999999999999998e91 < (*.f64 x y) < 6.5000000000000003e35 or 1.7e122 < (*.f64 x y) < 1.85000000000000008e160

    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 x around 0 96.7%

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

    if 6.5000000000000003e35 < (*.f64 x y) < 1.7e122

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.65 \cdot 10^{+91}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+35}:\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{+122}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{+160}:\\ \;\;\;\;\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 7: 65.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + b \cdot \left(a \cdot -0.25\right)\\ t_3 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+87}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{-293}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-64}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 0.048:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 4.2 \cdot 10^{+170}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* 0.0625 (* z t))))
        (t_2 (+ c (* b (* a -0.25))))
        (t_3 (+ c (* x y))))
   (if (<= (* x y) -6.2e+87)
     t_3
     (if (<= (* x y) 1.85e-293)
       t_1
       (if (<= (* x y) 4e-64)
         t_2
         (if (<= (* x y) 0.048) t_1 (if (<= (* x y) 4.2e+170) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (0.0625 * (z * t));
	double t_2 = c + (b * (a * -0.25));
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -6.2e+87) {
		tmp = t_3;
	} else if ((x * y) <= 1.85e-293) {
		tmp = t_1;
	} else if ((x * y) <= 4e-64) {
		tmp = t_2;
	} else if ((x * y) <= 0.048) {
		tmp = t_1;
	} else if ((x * y) <= 4.2e+170) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = c + (0.0625d0 * (z * t))
    t_2 = c + (b * (a * (-0.25d0)))
    t_3 = c + (x * y)
    if ((x * y) <= (-6.2d+87)) then
        tmp = t_3
    else if ((x * y) <= 1.85d-293) then
        tmp = t_1
    else if ((x * y) <= 4d-64) then
        tmp = t_2
    else if ((x * y) <= 0.048d0) then
        tmp = t_1
    else if ((x * y) <= 4.2d+170) then
        tmp = t_2
    else
        tmp = t_3
    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 + (0.0625 * (z * t));
	double t_2 = c + (b * (a * -0.25));
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -6.2e+87) {
		tmp = t_3;
	} else if ((x * y) <= 1.85e-293) {
		tmp = t_1;
	} else if ((x * y) <= 4e-64) {
		tmp = t_2;
	} else if ((x * y) <= 0.048) {
		tmp = t_1;
	} else if ((x * y) <= 4.2e+170) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (0.0625 * (z * t))
	t_2 = c + (b * (a * -0.25))
	t_3 = c + (x * y)
	tmp = 0
	if (x * y) <= -6.2e+87:
		tmp = t_3
	elif (x * y) <= 1.85e-293:
		tmp = t_1
	elif (x * y) <= 4e-64:
		tmp = t_2
	elif (x * y) <= 0.048:
		tmp = t_1
	elif (x * y) <= 4.2e+170:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(0.0625 * Float64(z * t)))
	t_2 = Float64(c + Float64(b * Float64(a * -0.25)))
	t_3 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -6.2e+87)
		tmp = t_3;
	elseif (Float64(x * y) <= 1.85e-293)
		tmp = t_1;
	elseif (Float64(x * y) <= 4e-64)
		tmp = t_2;
	elseif (Float64(x * y) <= 0.048)
		tmp = t_1;
	elseif (Float64(x * y) <= 4.2e+170)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (0.0625 * (z * t));
	t_2 = c + (b * (a * -0.25));
	t_3 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -6.2e+87)
		tmp = t_3;
	elseif ((x * y) <= 1.85e-293)
		tmp = t_1;
	elseif ((x * y) <= 4e-64)
		tmp = t_2;
	elseif ((x * y) <= 0.048)
		tmp = t_1;
	elseif ((x * y) <= 4.2e+170)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.2e+87], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 1.85e-293], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-64], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 0.048], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.2e+170], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{-293}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-64}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 0.048:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 4.2 \cdot 10^{+170}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -6.1999999999999999e87 or 4.19999999999999996e170 < (*.f64 x y)

    1. Initial program 94.5%

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

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

    if -6.1999999999999999e87 < (*.f64 x y) < 1.85000000000000004e-293 or 3.99999999999999986e-64 < (*.f64 x y) < 0.048000000000000001

    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 z around inf 71.3%

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

    if 1.85000000000000004e-293 < (*.f64 x y) < 3.99999999999999986e-64 or 0.048000000000000001 < (*.f64 x y) < 4.19999999999999996e170

    1. Initial program 98.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 inf 70.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+87}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{-293}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-64}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 0.048:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 4.2 \cdot 10^{+170}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 8: 43.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+91}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.1 \cdot 10^{-107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-315}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.75 \cdot 10^{+178}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* -0.25 (* a b))))
   (if (<= (* x y) -5.5e+91)
     (* x y)
     (if (<= (* x y) -1.1e-107)
       t_1
       (if (<= (* x y) -1e-315) c (if (<= (* x y) 1.75e+178) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = -0.25 * (a * b);
	double tmp;
	if ((x * y) <= -5.5e+91) {
		tmp = x * y;
	} else if ((x * y) <= -1.1e-107) {
		tmp = t_1;
	} else if ((x * y) <= -1e-315) {
		tmp = c;
	} else if ((x * y) <= 1.75e+178) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (-0.25d0) * (a * b)
    if ((x * y) <= (-5.5d+91)) then
        tmp = x * y
    else if ((x * y) <= (-1.1d-107)) then
        tmp = t_1
    else if ((x * y) <= (-1d-315)) then
        tmp = c
    else if ((x * y) <= 1.75d+178) then
        tmp = t_1
    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 t_1 = -0.25 * (a * b);
	double tmp;
	if ((x * y) <= -5.5e+91) {
		tmp = x * y;
	} else if ((x * y) <= -1.1e-107) {
		tmp = t_1;
	} else if ((x * y) <= -1e-315) {
		tmp = c;
	} else if ((x * y) <= 1.75e+178) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = -0.25 * (a * b)
	tmp = 0
	if (x * y) <= -5.5e+91:
		tmp = x * y
	elif (x * y) <= -1.1e-107:
		tmp = t_1
	elif (x * y) <= -1e-315:
		tmp = c
	elif (x * y) <= 1.75e+178:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(-0.25 * Float64(a * b))
	tmp = 0.0
	if (Float64(x * y) <= -5.5e+91)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.1e-107)
		tmp = t_1;
	elseif (Float64(x * y) <= -1e-315)
		tmp = c;
	elseif (Float64(x * y) <= 1.75e+178)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = -0.25 * (a * b);
	tmp = 0.0;
	if ((x * y) <= -5.5e+91)
		tmp = x * y;
	elseif ((x * y) <= -1.1e-107)
		tmp = t_1;
	elseif ((x * y) <= -1e-315)
		tmp = c;
	elseif ((x * y) <= 1.75e+178)
		tmp = t_1;
	else
		tmp = x * y;
	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[(x * y), $MachinePrecision], -5.5e+91], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.1e-107], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-315], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.75e+178], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -0.25 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+91}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -1.1 \cdot 10^{-107}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-315}:\\
\;\;\;\;c\\

\mathbf{elif}\;x \cdot y \leq 1.75 \cdot 10^{+178}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.4999999999999998e91 or 1.75e178 < (*.f64 x y)

    1. Initial program 94.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-94.3%

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

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

        \[\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/95.7%

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

        \[\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. sub-neg97.1%

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

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

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

        \[\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-neg97.1%

        \[\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/97.1%

        \[\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-def97.1%

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

        \[\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. *-commutative97.1%

        \[\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*97.1%

        \[\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-eval97.1%

        \[\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. Simplified97.1%

      \[\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. Step-by-step derivation
      1. fma-udef94.3%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr94.3%

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

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

    if -5.4999999999999998e91 < (*.f64 x y) < -1.10000000000000006e-107 or -9.999999985e-316 < (*.f64 x y) < 1.75e178

    1. Initial program 99.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-99.4%

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

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

        \[\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/99.4%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.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. sub-neg100.0%

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

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

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

        \[\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-neg99.9%

        \[\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/100.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-def100.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-1100.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. *-commutative100.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*100.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-eval100.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. Simplified100.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. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr100.0%

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

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

    if -1.10000000000000006e-107 < (*.f64 x y) < -9.999999985e-316

    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 c around inf 31.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+91}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.1 \cdot 10^{-107}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-315}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.75 \cdot 10^{+178}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 9: 44.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{+62}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{-109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -1.25 \cdot 10^{-307}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{+159}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))) (t_2 (* -0.25 (* a b))))
   (if (<= (* a b) -1.1e+62)
     t_2
     (if (<= (* a b) -1.3e-109)
       t_1
       (if (<= (* a b) -1.25e-307) c (if (<= (* a b) 2.3e+159) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double t_2 = -0.25 * (a * b);
	double tmp;
	if ((a * b) <= -1.1e+62) {
		tmp = t_2;
	} else if ((a * b) <= -1.3e-109) {
		tmp = t_1;
	} else if ((a * b) <= -1.25e-307) {
		tmp = c;
	} else if ((a * b) <= 2.3e+159) {
		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 = 0.0625d0 * (z * t)
    t_2 = (-0.25d0) * (a * b)
    if ((a * b) <= (-1.1d+62)) then
        tmp = t_2
    else if ((a * b) <= (-1.3d-109)) then
        tmp = t_1
    else if ((a * b) <= (-1.25d-307)) then
        tmp = c
    else if ((a * b) <= 2.3d+159) 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 = 0.0625 * (z * t);
	double t_2 = -0.25 * (a * b);
	double tmp;
	if ((a * b) <= -1.1e+62) {
		tmp = t_2;
	} else if ((a * b) <= -1.3e-109) {
		tmp = t_1;
	} else if ((a * b) <= -1.25e-307) {
		tmp = c;
	} else if ((a * b) <= 2.3e+159) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	t_2 = -0.25 * (a * b)
	tmp = 0
	if (a * b) <= -1.1e+62:
		tmp = t_2
	elif (a * b) <= -1.3e-109:
		tmp = t_1
	elif (a * b) <= -1.25e-307:
		tmp = c
	elif (a * b) <= 2.3e+159:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	t_2 = Float64(-0.25 * Float64(a * b))
	tmp = 0.0
	if (Float64(a * b) <= -1.1e+62)
		tmp = t_2;
	elseif (Float64(a * b) <= -1.3e-109)
		tmp = t_1;
	elseif (Float64(a * b) <= -1.25e-307)
		tmp = c;
	elseif (Float64(a * b) <= 2.3e+159)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (z * t);
	t_2 = -0.25 * (a * b);
	tmp = 0.0;
	if ((a * b) <= -1.1e+62)
		tmp = t_2;
	elseif ((a * b) <= -1.3e-109)
		tmp = t_1;
	elseif ((a * b) <= -1.25e-307)
		tmp = c;
	elseif ((a * b) <= 2.3e+159)
		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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.1e+62], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1.3e-109], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.25e-307], c, If[LessEqual[N[(a * b), $MachinePrecision], 2.3e+159], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{-109}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -1.25 \cdot 10^{-307}:\\
\;\;\;\;c\\

\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{+159}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.10000000000000007e62 or 2.29999999999999995e159 < (*.f64 a b)

    1. Initial program 95.8%

      \[\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.8%

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

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

        \[\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/95.8%

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

        \[\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. sub-neg97.9%

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

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

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

        \[\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-neg97.8%

        \[\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/97.9%

        \[\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-def97.9%

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

        \[\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. *-commutative97.9%

        \[\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*97.9%

        \[\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-eval97.9%

        \[\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. Simplified97.9%

      \[\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. Step-by-step derivation
      1. fma-udef96.8%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr96.8%

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

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

    if -1.10000000000000007e62 < (*.f64 a b) < -1.2999999999999999e-109 or -1.25000000000000003e-307 < (*.f64 a b) < 2.29999999999999995e159

    1. Initial program 99.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-99.3%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.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/100.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-neg100.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. sub-neg100.0%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\frac{a \cdot b}{4}\right) + \color{blue}{c}\right)\right) \]
      9. associate-/l*100.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-neg100.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/100.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-def100.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-1100.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. *-commutative100.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*100.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-eval100.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. Simplified100.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. Step-by-step derivation
      1. fma-udef99.3%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr99.3%

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

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

    if -1.2999999999999999e-109 < (*.f64 a b) < -1.25000000000000003e-307

    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 c around inf 54.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{+62}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{-109}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq -1.25 \cdot 10^{-307}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{+159}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 10: 87.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+203} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+106}\right):\\
\;\;\;\;x \cdot y - \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}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2e203 or 2.00000000000000018e106 < (*.f64 a b)

    1. Initial program 95.8%

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

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

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

    if -2e203 < (*.f64 a b) < 2.00000000000000018e106

    1. Initial program 98.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+203} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+106}\right):\\ \;\;\;\;x \cdot y - \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 11: 86.1% accurate, 0.9× 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}\;a \cdot b \leq -2 \cdot 10^{+50}:\\ \;\;\;\;t_2 - t_1\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+106}:\\ \;\;\;\;c + \left(x \cdot y + t_2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - t_1\\ \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 (<= (* a b) -2e+50)
     (- t_2 t_1)
     (if (<= (* a b) 2e+106) (+ c (+ (* x y) t_2)) (- (* x y) t_1)))))
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 ((a * b) <= -2e+50) {
		tmp = t_2 - t_1;
	} else if ((a * b) <= 2e+106) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = (x * y) - t_1;
	}
	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 ((a * b) <= (-2d+50)) then
        tmp = t_2 - t_1
    else if ((a * b) <= 2d+106) then
        tmp = c + ((x * y) + t_2)
    else
        tmp = (x * y) - 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 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if ((a * b) <= -2e+50) {
		tmp = t_2 - t_1;
	} else if ((a * b) <= 2e+106) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = (x * y) - t_1;
	}
	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 (a * b) <= -2e+50:
		tmp = t_2 - t_1
	elif (a * b) <= 2e+106:
		tmp = c + ((x * y) + t_2)
	else:
		tmp = (x * y) - t_1
	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(a * b) <= -2e+50)
		tmp = Float64(t_2 - t_1);
	elseif (Float64(a * b) <= 2e+106)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	else
		tmp = Float64(Float64(x * y) - t_1);
	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 ((a * b) <= -2e+50)
		tmp = t_2 - t_1;
	elseif ((a * b) <= 2e+106)
		tmp = c + ((x * y) + t_2);
	else
		tmp = (x * y) - t_1;
	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[(a * b), $MachinePrecision], -2e+50], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+106], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - t$95$1), $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}\;a \cdot b \leq -2 \cdot 10^{+50}:\\
\;\;\;\;t_2 - t_1\\

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+106}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\

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


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

    1. Initial program 96.9%

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    3. Taylor expanded in c around 0 81.1%

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

    if -2.0000000000000002e50 < (*.f64 a b) < 2.00000000000000018e106

    1. Initial program 99.3%

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

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

    if 2.00000000000000018e106 < (*.f64 a b)

    1. Initial program 94.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+50}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+106}:\\ \;\;\;\;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 12: 87.3% accurate, 0.9× 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}\;a \cdot b \leq -2 \cdot 10^{+50}:\\ \;\;\;\;t_2 - t_1\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+106}:\\ \;\;\;\;c + \left(x \cdot y + t_2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + x \cdot y\right) - t_1\\ \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 (<= (* a b) -2e+50)
     (- t_2 t_1)
     (if (<= (* a b) 2e+106) (+ c (+ (* x y) t_2)) (- (+ c (* x y)) t_1)))))
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 ((a * b) <= -2e+50) {
		tmp = t_2 - t_1;
	} else if ((a * b) <= 2e+106) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = (c + (x * y)) - t_1;
	}
	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 ((a * b) <= (-2d+50)) then
        tmp = t_2 - t_1
    else if ((a * b) <= 2d+106) then
        tmp = c + ((x * y) + t_2)
    else
        tmp = (c + (x * y)) - 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 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if ((a * b) <= -2e+50) {
		tmp = t_2 - t_1;
	} else if ((a * b) <= 2e+106) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = (c + (x * y)) - t_1;
	}
	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 (a * b) <= -2e+50:
		tmp = t_2 - t_1
	elif (a * b) <= 2e+106:
		tmp = c + ((x * y) + t_2)
	else:
		tmp = (c + (x * y)) - t_1
	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(a * b) <= -2e+50)
		tmp = Float64(t_2 - t_1);
	elseif (Float64(a * b) <= 2e+106)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	else
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	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 ((a * b) <= -2e+50)
		tmp = t_2 - t_1;
	elseif ((a * b) <= 2e+106)
		tmp = c + ((x * y) + t_2);
	else
		tmp = (c + (x * y)) - t_1;
	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[(a * b), $MachinePrecision], -2e+50], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+106], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $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}\;a \cdot b \leq -2 \cdot 10^{+50}:\\
\;\;\;\;t_2 - t_1\\

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+106}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\

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


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

    1. Initial program 96.9%

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    3. Taylor expanded in c around 0 81.1%

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

    if -2.0000000000000002e50 < (*.f64 a b) < 2.00000000000000018e106

    1. Initial program 99.3%

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

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

    if 2.00000000000000018e106 < (*.f64 a b)

    1. Initial program 94.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+50}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+106}:\\ \;\;\;\;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 13: 97.8% accurate, 1.0× speedup?

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

\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Derivation
  1. Initial program 98.0%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Final simplification98.0%

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

Alternative 14: 54.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+175}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 5.8 \cdot 10^{-223}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{-81}:\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.49999999999999977e175 or 3.09999999999999988e-81 < x

    1. Initial program 97.3%

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

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

    if -6.49999999999999977e175 < x < 5.8000000000000001e-223

    1. Initial program 99.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 61.0%

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

    if 5.8000000000000001e-223 < x < 3.09999999999999988e-81

    1. Initial program 96.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-96.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+96.2%

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

        \[\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/96.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.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. sub-neg100.0%

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

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

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

        \[\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-neg99.9%

        \[\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/100.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-def100.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-1100.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. *-commutative100.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*100.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-eval100.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. Simplified100.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. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+175}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-223}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-81}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 15: 38.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.5 \cdot 10^{+241}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 1.42 \cdot 10^{+178}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* x y) -3.5e+241) (* x y) (if (<= (* x y) 1.42e+178) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((x * y) <= -3.5e+241) {
		tmp = x * y;
	} else if ((x * y) <= 1.42e+178) {
		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) <= (-3.5d+241)) then
        tmp = x * y
    else if ((x * y) <= 1.42d+178) 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) <= -3.5e+241) {
		tmp = x * y;
	} else if ((x * y) <= 1.42e+178) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (x * y) <= -3.5e+241:
		tmp = x * y
	elif (x * y) <= 1.42e+178:
		tmp = c
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(x * y) <= -3.5e+241)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 1.42e+178)
		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) <= -3.5e+241)
		tmp = x * y;
	elseif ((x * y) <= 1.42e+178)
		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], -3.5e+241], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.42e+178], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 1.42 \cdot 10^{+178}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -3.5e241 or 1.41999999999999999e178 < (*.f64 x y)

    1. Initial program 92.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-92.6%

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

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

        \[\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/94.4%

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

        \[\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. sub-neg96.3%

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

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

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

        \[\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-neg96.2%

        \[\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/96.3%

        \[\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-def96.3%

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

        \[\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. *-commutative96.3%

        \[\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*96.3%

        \[\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-eval96.3%

        \[\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. Simplified96.3%

      \[\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. Step-by-step derivation
      1. fma-udef92.6%

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

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

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

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

        \[\leadsto x \cdot y + \mathsf{fma}\left(z \cdot 0.0625, t, \mathsf{fma}\left(a \cdot \color{blue}{-0.25}, b, c\right)\right) \]
    5. Applied egg-rr92.6%

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

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

    if -3.5e241 < (*.f64 x y) < 1.41999999999999999e178

    1. Initial program 99.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.5 \cdot 10^{+241}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 1.42 \cdot 10^{+178}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 16: 22.3% 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 98.0%

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

    \[\leadsto \color{blue}{c} \]
  3. Final simplification21.1%

    \[\leadsto c \]

Reproduce

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