Average Error: 45.3 → 34.9
Time: 19.8s
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 -0.0021609081035548925:\\ \;\;\;\;(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\left((\left(-x\right) \cdot \left(-y\right) + \left(-z\right))_* - y \cdot x\right) - \left(z + 1\right)} \cdot \sqrt[3]{\left((\left(-x\right) \cdot \left(-y\right) + \left(-z\right))_* - y \cdot x\right) - \left(z + 1\right)}\right) \cdot \sqrt[3]{\left((\left(-x\right) \cdot \left(-y\right) + \left(-z\right))_* - y \cdot x\right) - \left(z + 1\right)}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.3
Target0
Herbie34.9
\[-1\]

Derivation

  1. Split input into 2 regimes
  2. if z < -0.0021609081035548925

    1. Initial program 60.1

      \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]

    if -0.0021609081035548925 < z

    1. Initial program 40.5

      \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
    2. Taylor expanded around inf 62.3

      \[\leadsto \color{blue}{(\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - \left(z + \left(1 + y \cdot x\right)\right)}\]
    3. Taylor expanded around -inf 41.1

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

      \[\leadsto \color{blue}{(\left(-x\right) \cdot \left(-y\right) + \left(-z\right))_* - \left(y \cdot x + \left(z + 1\right)\right)}\]
    5. Using strategy rm
    6. Applied associate--r+26.8

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

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

Runtime

Time bar (total: 19.8s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

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