Average Error: 0.0 → 0
Time: 5.3s
Precision: 64
\[x \cdot 116 - 16\]
\[\mathsf{fma}\left(116, x, -16\right)\]
x \cdot 116 - 16
\mathsf{fma}\left(116, x, -16\right)
double f(double x) {
        double r159821 = x;
        double r159822 = 116.0;
        double r159823 = r159821 * r159822;
        double r159824 = 16.0;
        double r159825 = r159823 - r159824;
        return r159825;
}

double f(double x) {
        double r159826 = 116.0;
        double r159827 = x;
        double r159828 = 16.0;
        double r159829 = -r159828;
        double r159830 = fma(r159826, r159827, r159829);
        return r159830;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x \cdot 116 - 16\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.8

    \[\leadsto x \cdot 116 - \color{blue}{\left(\sqrt[3]{16} \cdot \sqrt[3]{16}\right) \cdot \sqrt[3]{16}}\]
  4. Applied prod-diff0.8

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, 116, -\sqrt[3]{16} \cdot \left(\sqrt[3]{16} \cdot \sqrt[3]{16}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{16}, \sqrt[3]{16} \cdot \sqrt[3]{16}, \sqrt[3]{16} \cdot \left(\sqrt[3]{16} \cdot \sqrt[3]{16}\right)\right)}\]
  5. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(116, x, -16\right)} + \mathsf{fma}\left(-\sqrt[3]{16}, \sqrt[3]{16} \cdot \sqrt[3]{16}, \sqrt[3]{16} \cdot \left(\sqrt[3]{16} \cdot \sqrt[3]{16}\right)\right)\]
  6. Simplified0

    \[\leadsto \mathsf{fma}\left(116, x, -16\right) + \color{blue}{0}\]
  7. Final simplification0

    \[\leadsto \mathsf{fma}\left(116, x, -16\right)\]

Reproduce

herbie shell --seed 2019305 +o rules:numerics
(FPCore (x)
  :name "Data.Colour.CIE:lightness from colour-2.3.3"
  :precision binary64
  (- (* x 116) 16))