Average Error: 45.5 → 20.8
Time: 1.2m
Precision: 64
Internal Precision: 2432
\[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -354554309650.3642:\\ \;\;\;\;\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}}\\ \mathbf{if}\;z \le 5.692299011485595 \cdot 10^{+43}:\\ \;\;\;\;\left((x \cdot y + z)_* - y \cdot x\right) - \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.5
Target0
Herbie20.8
\[-1\]

Derivation

  1. Split input into 2 regimes
  2. if z < -354554309650.3642 or 5.692299011485595e+43 < z

    1. Initial program 62.0

      \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt62.0

      \[\leadsto \color{blue}{\left(\sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)} \cdot \sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)}\right) \cdot \sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)}}\]
    4. Taylor expanded around 0 62.0

      \[\leadsto \left(\sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)} \cdot \sqrt[3]{\color{blue}{(x \cdot y + z)_* - \left(z + \left(1 + y \cdot x\right)\right)}}\right) \cdot \sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)}\]
    5. Applied simplify31.3

      \[\leadsto \color{blue}{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt31.3

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt31.3

      \[\leadsto \left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}}}\]

    if -354554309650.3642 < z < 5.692299011485595e+43

    1. Initial program 31.6

      \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt31.5

      \[\leadsto \color{blue}{\left(\sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)} \cdot \sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)}\right) \cdot \sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)}}\]
    4. Taylor expanded around 0 31.5

      \[\leadsto \left(\sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)} \cdot \sqrt[3]{\color{blue}{(x \cdot y + z)_* - \left(z + \left(1 + y \cdot x\right)\right)}}\right) \cdot \sqrt[3]{(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)}\]
    5. Applied simplify30.3

      \[\leadsto \color{blue}{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt30.3

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}}\]
    8. Taylor expanded around 0 31.6

      \[\leadsto \left(\sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)} \cdot \sqrt[3]{\left((x \cdot y + z)_* - z\right) - \left(1 + y \cdot x\right)}\right) \cdot \sqrt[3]{\color{blue}{(x \cdot y + z)_* - \left(z + \left(1 + y \cdot x\right)\right)}}\]
    9. Applied simplify11.8

      \[\leadsto \color{blue}{\left((x \cdot y + z)_* - y \cdot x\right) - \left(z + 1\right)}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 1.2m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

  (- (fma x y z) (+ 1 (+ (* x y) z))))