Average Error: 45.1 → 20.0
Time: 20.7s
Precision: 64
Internal Precision: 2432
\[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\begin{array}{l} \mathbf{if}\;\left((x \cdot y + z)_* - y \cdot x\right) - \left(z + 1\right) \le -0.9999999999032056:\\ \;\;\;\;\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((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.1
Target0
Herbie20.0
\[-1\]

Derivation

  1. Split input into 2 regimes
  2. if (- (- (fma x y z) (* y x)) (+ z 1)) < -0.9999999999032056

    1. Initial program 26.7

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

      \[\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 26.7

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

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

      \[\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 26.7

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

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

    if -0.9999999999032056 < (- (- (fma x y z) (* y x)) (+ z 1))

    1. Initial program 62.4

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

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

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

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

      \[\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)}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 20.7s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

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