Average Error: 45.5 → 24.5
Time: 16.2s
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 -6.793618503523319 \cdot 10^{-17}:\\ \;\;\;\;\log \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)\\ \mathbf{if}\;z \le 1.6241870003327005 \cdot 10^{+17}:\\ \;\;\;\;(x \cdot y + z)_* - \left(1 + \sqrt[3]{x \cdot y + z} \cdot \sqrt[3]{\left(x \cdot y + z\right) \cdot \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{1}{y \cdot x}\right) - 1}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.5
Comparison0.8
Herbie24.5
\[ -1 \]

Derivation

  1. Split input into 2 regimes.
  2. if z < -6.793618503523319e-17 or 1.6241870003327005e+17 < z

    1. Initial program 61.6

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

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

      \[\leadsto (\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - \left(1 + e^{-\left(\log y + \log x\right)}\right)\]
    5. Taylor expanded around inf 55.5

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

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

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

      \[\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^{\frac{1}{y \cdot x} + 1}\right)\]
    10. Applied diff-log 31.7

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

      \[\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)}\]

    if -6.793618503523319e-17 < z < 1.6241870003327005e+17

    1. Initial program 29.4

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

      \[\leadsto (x \cdot y + z)_* - \left(1 + \color{blue}{\sqrt[3]{{\left(x \cdot y + z\right)}^3}}\right)\]
    4. Using strategy rm
    5. Applied cube-mult 30.0

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

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

Runtime

Time bar (total: 16.2s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (x y z)
  :name "simple fma test"

  :target
  -1

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