Average Error: 45.2 → 22.4
Time: 51.4s
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 -7716859603067048.0:\\ \;\;\;\;\log \left(e^{\left((\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - \frac{\frac{1}{y}}{x}\right) - 1}\right)\\ \mathbf{if}\;z \le 331764567287.1149:\\ \;\;\;\;(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\left((\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - \frac{\frac{1}{y}}{x}\right) - 1}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.2
Target0
Herbie22.4
\[-1\]

Derivation

  1. Split input into 2 regimes
  2. if z < -7716859603067048.0 or 331764567287.1149 < z

    1. Initial program 61.9

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

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

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

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

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

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

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

      \[\leadsto \log \color{blue}{\left(e^{\left((\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - \frac{1}{y \cdot x}\right) - 1}\right)}\]
    11. Using strategy rm
    12. Applied associate-/r*14.1

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

    if -7716859603067048.0 < z < 331764567287.1149

    1. Initial program 29.9

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

Runtime

Time bar (total: 51.4s)Debug logProfile

herbie shell --seed '#(1063027428 1192549564 1443466578 604016274 3637110559 1698629644)' 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

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