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

Percentage Accurate: 97.7% → 99.0%
Time: 13.0s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 97.7% 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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
    2. associate-+l+98.0%

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

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

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

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

      \[\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) \]
    7. neg-sub098.8%

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

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

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

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

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

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

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

      \[\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) \]
    15. neg-mul-198.8%

      \[\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) \]
    16. *-commutative98.8%

      \[\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) \]
    17. associate-/l*98.8%

      \[\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) \]
    18. metadata-eval98.8%

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

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

    \[\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.4% accurate, 0.1× speedup?

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

\\
c + \mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, z \cdot t, x \cdot y\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. Taylor expanded in x around 0 98.0%

    \[\leadsto \color{blue}{\left(\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)\right)} + c \]
  3. Step-by-step derivation
    1. cancel-sign-sub-inv98.0%

      \[\leadsto \color{blue}{\left(\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right) + \left(-0.25\right) \cdot \left(a \cdot b\right)\right)} + c \]
    2. metadata-eval98.0%

      \[\leadsto \left(\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right) + \color{blue}{-0.25} \cdot \left(a \cdot b\right)\right) + c \]
    3. +-commutative98.0%

      \[\leadsto \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right) + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\right)} + c \]
    4. *-commutative98.0%

      \[\leadsto \left(\color{blue}{\left(a \cdot b\right) \cdot -0.25} + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\right) + c \]
    5. associate-*r*98.0%

      \[\leadsto \left(\color{blue}{a \cdot \left(b \cdot -0.25\right)} + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\right) + c \]
    6. +-commutative98.0%

      \[\leadsto \left(a \cdot \left(b \cdot -0.25\right) + \color{blue}{\left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)}\right) + c \]
    7. associate-*r*98.0%

      \[\leadsto \left(a \cdot \left(b \cdot -0.25\right) + \left(x \cdot y + \color{blue}{\left(0.0625 \cdot t\right) \cdot z}\right)\right) + c \]
    8. *-commutative98.0%

      \[\leadsto \left(a \cdot \left(b \cdot -0.25\right) + \left(x \cdot y + \color{blue}{\left(t \cdot 0.0625\right)} \cdot z\right)\right) + c \]
    9. *-commutative98.0%

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, b \cdot -0.25, \color{blue}{z \cdot \left(t \cdot 0.0625\right) + x \cdot y}\right) + c \]
    14. associate-*r*98.8%

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 0.1× speedup?

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

\\
\left(x \cdot y + \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right) + z \cdot \left(t \cdot 0.0625\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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
    2. associate-+l+98.0%

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

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

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

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

      \[\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) \]
    7. neg-sub098.8%

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

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

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

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

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

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

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

      \[\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) \]
    15. neg-mul-198.8%

      \[\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) \]
    16. *-commutative98.8%

      \[\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) \]
    17. associate-/l*98.8%

      \[\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) \]
    18. metadata-eval98.8%

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

    \[\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.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. fma-udef98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\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. sub-neg98.0%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(-\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}\right)} + \left(-\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}\right) + \left(-\left(\frac{a \cdot b}{4} - c\right)\right) \]
    5. neg-sub098.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + -0.25 \cdot \left(a \cdot b\right)\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+37}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq -4.4 \cdot 10^{-111}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 3.3 \cdot 10^{+66}:\\ \;\;\;\;c + t_2\\ \mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+123}:\\ \;\;\;\;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.25 (* a b))))
        (t_2 (* 0.0625 (* z t)))
        (t_3 (+ c (* x y))))
   (if (<= (* x y) -3.2e+37)
     t_3
     (if (<= (* x y) -4.4e-111)
       t_1
       (if (<= (* x y) 3.3e+66)
         (+ c t_2)
         (if (<= (* x y) 2.5e+101) t_1 (if (<= (* x y) 4e+123) 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.25 * (a * b));
	double t_2 = 0.0625 * (z * t);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -3.2e+37) {
		tmp = t_3;
	} else if ((x * y) <= -4.4e-111) {
		tmp = t_1;
	} else if ((x * y) <= 3.3e+66) {
		tmp = c + t_2;
	} else if ((x * y) <= 2.5e+101) {
		tmp = t_1;
	} else if ((x * y) <= 4e+123) {
		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.25d0) * (a * b))
    t_2 = 0.0625d0 * (z * t)
    t_3 = c + (x * y)
    if ((x * y) <= (-3.2d+37)) then
        tmp = t_3
    else if ((x * y) <= (-4.4d-111)) then
        tmp = t_1
    else if ((x * y) <= 3.3d+66) then
        tmp = c + t_2
    else if ((x * y) <= 2.5d+101) then
        tmp = t_1
    else if ((x * y) <= 4d+123) 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.25 * (a * b));
	double t_2 = 0.0625 * (z * t);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -3.2e+37) {
		tmp = t_3;
	} else if ((x * y) <= -4.4e-111) {
		tmp = t_1;
	} else if ((x * y) <= 3.3e+66) {
		tmp = c + t_2;
	} else if ((x * y) <= 2.5e+101) {
		tmp = t_1;
	} else if ((x * y) <= 4e+123) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (-0.25 * (a * b))
	t_2 = 0.0625 * (z * t)
	t_3 = c + (x * y)
	tmp = 0
	if (x * y) <= -3.2e+37:
		tmp = t_3
	elif (x * y) <= -4.4e-111:
		tmp = t_1
	elif (x * y) <= 3.3e+66:
		tmp = c + t_2
	elif (x * y) <= 2.5e+101:
		tmp = t_1
	elif (x * y) <= 4e+123:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(-0.25 * Float64(a * b)))
	t_2 = Float64(0.0625 * Float64(z * t))
	t_3 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -3.2e+37)
		tmp = t_3;
	elseif (Float64(x * y) <= -4.4e-111)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.3e+66)
		tmp = Float64(c + t_2);
	elseif (Float64(x * y) <= 2.5e+101)
		tmp = t_1;
	elseif (Float64(x * y) <= 4e+123)
		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.25 * (a * b));
	t_2 = 0.0625 * (z * t);
	t_3 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -3.2e+37)
		tmp = t_3;
	elseif ((x * y) <= -4.4e-111)
		tmp = t_1;
	elseif ((x * y) <= 3.3e+66)
		tmp = c + t_2;
	elseif ((x * y) <= 2.5e+101)
		tmp = t_1;
	elseif ((x * y) <= 4e+123)
		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.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.2e+37], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -4.4e-111], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.3e+66], N[(c + t$95$2), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+101], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+123], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -4.4 \cdot 10^{-111}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 3.3 \cdot 10^{+66}:\\
\;\;\;\;c + t_2\\

\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+123}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -3.20000000000000014e37 or 3.99999999999999991e123 < (*.f64 x y)

    1. Initial program 94.8%

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

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

    if -3.20000000000000014e37 < (*.f64 x y) < -4.4e-111 or 3.3000000000000001e66 < (*.f64 x y) < 2.49999999999999994e101

    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 a around inf 79.7%

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

    if -4.4e-111 < (*.f64 x y) < 3.3000000000000001e66

    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 73.9%

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

    if 2.49999999999999994e101 < (*.f64 x y) < 3.99999999999999991e123

    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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
      2. associate-+l+100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \frac{\color{blue}{-a}}{\frac{4}{b}} + c\right)\right) \]
      13. 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) \]
      14. 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) \]
      15. 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) \]
      16. *-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) \]
      17. 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) \]
      18. 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. fma-udef100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+37}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -4.4 \cdot 10^{-111}:\\ \;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \cdot y \leq 3.3 \cdot 10^{+66}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+123}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 6: 65.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -8 \cdot 10^{+82}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -2.8 \cdot 10^{+60}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\

\mathbf{elif}\;a \cdot b \leq 1.65 \cdot 10^{+74}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -2.0499999999999999e116 or 1.6500000000000001e74 < (*.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. Taylor expanded in a around inf 75.5%

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

    if -2.0499999999999999e116 < (*.f64 a b) < -7.9999999999999997e82 or -2.8e60 < (*.f64 a b) < 1.6500000000000001e74

    1. Initial program 98.8%

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

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

    if -7.9999999999999997e82 < (*.f64 a b) < -2.8e60

    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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
      2. associate-+l+100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \frac{\color{blue}{-a}}{\frac{4}{b}} + c\right)\right) \]
      13. 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) \]
      14. 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) \]
      15. 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) \]
      16. *-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) \]
      17. 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) \]
      18. 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. fma-udef100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 65.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+37}:\\
\;\;\;\;c + x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-110}:\\
\;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\

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

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


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

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

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

    if -9.4999999999999995e37 < (*.f64 x y) < -2.8e-110

    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 a around inf 83.7%

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

    if -2.8e-110 < (*.f64 x y) < 5.00000000000000028e-33

    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 76.0%

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

    if 5.00000000000000028e-33 < (*.f64 x y)

    1. Initial program 97.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+97.4%

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

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

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

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

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

        \[\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) \]
      7. neg-sub098.7%

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

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

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

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

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

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

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

        \[\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) \]
      15. neg-mul-198.7%

        \[\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) \]
      16. *-commutative98.7%

        \[\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) \]
      17. associate-/l*98.7%

        \[\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) \]
      18. metadata-eval98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+37}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-110}:\\ \;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-33}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \]

Alternative 8: 66.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-109}:\\
\;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.8000000000000004e42 or 7.9e68 < (*.f64 x y)

    1. Initial program 95.2%

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

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

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

    if -9.8000000000000004e42 < (*.f64 x y) < -4e-109

    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 a around inf 81.2%

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

    if -4e-109 < (*.f64 x y) < 7.9e68

    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 73.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.8 \cdot 10^{+42}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-109}:\\ \;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \cdot y \leq 7.9 \cdot 10^{+68}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]

Alternative 9: 89.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116} \lor \neg \left(a \cdot b \leq 1.5 \cdot 10^{+74}\right):\\ \;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + t_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))))
   (if (or (<= (* a b) -2.05e+116) (not (<= (* a b) 1.5e+74)))
     (- (+ c t_1) (* (* a b) 0.25))
     (+ c (+ (* 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 tmp;
	if (((a * b) <= -2.05e+116) || !((a * b) <= 1.5e+74)) {
		tmp = (c + t_1) - ((a * b) * 0.25);
	} 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) :: tmp
    t_1 = 0.0625d0 * (z * t)
    if (((a * b) <= (-2.05d+116)) .or. (.not. ((a * b) <= 1.5d+74))) then
        tmp = (c + t_1) - ((a * b) * 0.25d0)
    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 = 0.0625 * (z * t);
	double tmp;
	if (((a * b) <= -2.05e+116) || !((a * b) <= 1.5e+74)) {
		tmp = (c + t_1) - ((a * b) * 0.25);
	} else {
		tmp = c + ((x * y) + t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	tmp = 0
	if ((a * b) <= -2.05e+116) or not ((a * b) <= 1.5e+74):
		tmp = (c + t_1) - ((a * b) * 0.25)
	else:
		tmp = c + ((x * y) + t_1)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	tmp = 0.0
	if ((Float64(a * b) <= -2.05e+116) || !(Float64(a * b) <= 1.5e+74))
		tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25));
	else
		tmp = Float64(c + 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);
	tmp = 0.0;
	if (((a * b) <= -2.05e+116) || ~(((a * b) <= 1.5e+74)))
		tmp = (c + t_1) - ((a * b) * 0.25);
	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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.05e+116], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.5e+74]], $MachinePrecision]], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116} \lor \neg \left(a \cdot b \leq 1.5 \cdot 10^{+74}\right):\\
\;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2.0499999999999999e116 or 1.5e74 < (*.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. Taylor expanded in x around 0 90.7%

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

    if -2.0499999999999999e116 < (*.f64 a b) < 1.5e74

    1. Initial program 98.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116} \lor \neg \left(a \cdot b \leq 1.5 \cdot 10^{+74}\right):\\ \;\;\;\;\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 10: 86.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+165} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+234}\right):\\
\;\;\;\;t_1 - \left(a \cdot b\right) \cdot 0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -9.99999999999999899e164 or 5.0000000000000003e234 < (*.f64 a b)

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

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

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

    if -9.99999999999999899e164 < (*.f64 a b) < 5.0000000000000003e234

    1. Initial program 99.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Taylor expanded in a around 0 89.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 simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+165} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+234}\right):\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\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 11: 85.7% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 94.4%

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

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

    if -2.0499999999999999e116 < (*.f64 a b) < 1.99999999999999998e239

    1. Initial program 99.0%

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

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

    if 1.99999999999999998e239 < (*.f64 a b)

    1. Initial program 95.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116}:\\ \;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+239}:\\ \;\;\;\;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: 88.5% 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 -1 \cdot 10^{+165}:\\ \;\;\;\;t_2 - t_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+66}:\\ \;\;\;\;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) -1e+165)
     (- t_2 t_1)
     (if (<= (* a b) 1e+66) (+ 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) <= -1e+165) {
		tmp = t_2 - t_1;
	} else if ((a * b) <= 1e+66) {
		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) <= (-1d+165)) then
        tmp = t_2 - t_1
    else if ((a * b) <= 1d+66) 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) <= -1e+165) {
		tmp = t_2 - t_1;
	} else if ((a * b) <= 1e+66) {
		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) <= -1e+165:
		tmp = t_2 - t_1
	elif (a * b) <= 1e+66:
		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) <= -1e+165)
		tmp = Float64(t_2 - t_1);
	elseif (Float64(a * b) <= 1e+66)
		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) <= -1e+165)
		tmp = t_2 - t_1;
	elseif ((a * b) <= 1e+66)
		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], -1e+165], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+66], 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 -1 \cdot 10^{+165}:\\
\;\;\;\;t_2 - t_1\\

\mathbf{elif}\;a \cdot b \leq 10^{+66}:\\
\;\;\;\;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) < -9.99999999999999899e164

    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 x around 0 96.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 92.5%

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

    if -9.99999999999999899e164 < (*.f64 a b) < 9.99999999999999945e65

    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 92.3%

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

    if 9.99999999999999945e65 < (*.f64 a b)

    1. Initial program 97.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 78.7%

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

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

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

\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \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 \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \color{blue}{\frac{a}{\frac{4}{b}}}\right) + c \]
    2. associate-/r/98.0%

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

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

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

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

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

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

Alternative 14: 97.7% 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 15: 36.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-130} \lor \neg \left(t \leq 440000000000\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;c\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.9999999999999996e-130 or 4.4e11 < t

    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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
      2. associate-+l+98.0%

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

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

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

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

        \[\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) \]
      7. neg-sub098.7%

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

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

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

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

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

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

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

        \[\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) \]
      15. neg-mul-198.7%

        \[\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) \]
      16. *-commutative98.7%

        \[\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) \]
      17. associate-/l*98.7%

        \[\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) \]
      18. metadata-eval98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999996e-130 < t < 4.4e11

    1. Initial program 97.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-130} \lor \neg \left(t \leq 440000000000\right):\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 16: 54.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+157} \lor \neg \left(z \leq 4.1 \cdot 10^{-16}\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3000000000000002e157 or 4.10000000000000006e-16 < z

    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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
      2. associate-+l+98.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      14. fma-def99.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) \]
      15. neg-mul-199.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) \]
      16. *-commutative99.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) \]
      17. associate-/l*99.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) \]
      18. metadata-eval99.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. Simplified99.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-udef98.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. fma-udef98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3000000000000002e157 < z < 4.10000000000000006e-16

    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 x around inf 56.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+157} \lor \neg \left(z \leq 4.1 \cdot 10^{-16}\right):\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 17: 22.2% 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 25.0%

    \[\leadsto \color{blue}{c} \]
  3. Final simplification25.0%

    \[\leadsto c \]

Reproduce

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