Average Error: 45.1 → 20.1
Time: 18.5s
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 -72609.22878773515:\\ \;\;\;\;\log \left(e^{\left(\sqrt[3]{\left(\left((x \cdot y + z)_* - z\right) - 1\right) - y \cdot x} \cdot \sqrt[3]{\left(\left((x \cdot y + z)_* - z\right) - 1\right) - y \cdot x}\right) \cdot \sqrt[3]{\left(\left((x \cdot y + z)_* - z\right) - 1\right) - y \cdot x}}\right)\\ \mathbf{if}\;z \le 681227749634197.2:\\ \;\;\;\;\left((x \cdot y + z)_* - y \cdot x\right) - \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\left(\sqrt[3]{\left(\left((x \cdot y + z)_* - z\right) - 1\right) - y \cdot x} \cdot \sqrt[3]{\left(\left((x \cdot y + z)_* - z\right) - 1\right) - y \cdot x}\right) \cdot \sqrt[3]{\left(\left((x \cdot y + z)_* - z\right) - 1\right) - y \cdot x}}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Split input into 2 regimes
  2. if z < -72609.22878773515 or 681227749634197.2 < z

    1. Initial program 61.4

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

      \[\leadsto (x \cdot y + z)_* - \color{blue}{\log \left(e^{1 + \left(x \cdot y + z\right)}\right)}\]
    4. Applied add-log-exp63.6

      \[\leadsto \color{blue}{\log \left(e^{(x \cdot y + z)_*}\right)} - \log \left(e^{1 + \left(x \cdot y + z\right)}\right)\]
    5. Applied diff-log63.6

      \[\leadsto \color{blue}{\log \left(\frac{e^{(x \cdot y + z)_*}}{e^{1 + \left(x \cdot y + z\right)}}\right)}\]
    6. Applied simplify61.5

      \[\leadsto \log \color{blue}{\left(e^{\left((x \cdot y + z)_* - \left(z + 1\right)\right) - y \cdot x}\right)}\]
    7. Using strategy rm
    8. Applied associate--r+31.4

      \[\leadsto \log \left(e^{\color{blue}{\left(\left((x \cdot y + z)_* - z\right) - 1\right)} - y \cdot x}\right)\]
    9. Using strategy rm
    10. Applied add-cube-cbrt31.4

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

    if -72609.22878773515 < z < 681227749634197.2

    1. Initial program 29.7

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

      \[\leadsto (x \cdot y + z)_* - \color{blue}{\log \left(e^{1 + \left(x \cdot y + z\right)}\right)}\]
    4. Applied add-log-exp32.2

      \[\leadsto \color{blue}{\log \left(e^{(x \cdot y + z)_*}\right)} - \log \left(e^{1 + \left(x \cdot y + z\right)}\right)\]
    5. Applied diff-log32.2

      \[\leadsto \color{blue}{\log \left(\frac{e^{(x \cdot y + z)_*}}{e^{1 + \left(x \cdot y + z\right)}}\right)}\]
    6. Applied simplify29.7

      \[\leadsto \log \color{blue}{\left(e^{\left((x \cdot y + z)_* - \left(z + 1\right)\right) - y \cdot x}\right)}\]
    7. Taylor expanded around 0 29.7

      \[\leadsto \log \left(e^{\color{blue}{(x \cdot y + z)_* - \left(z + \left(1 + y \cdot x\right)\right)}}\right)\]
    8. Applied simplify9.5

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

Runtime

Time bar (total: 18.5s)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))))