Average Error: 45.2 → 8.8
Time: 56.9s
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 -3.97775270147107 \cdot 10^{-10}:\\ \;\;\;\;\left((\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - {y}^{\left(\frac{-1}{3} + \frac{-2}{3}\right)} \cdot {x}^{\left(\frac{-1}{3} + \frac{-2}{3}\right)}\right) - 1\\ \mathbf{if}\;z \le 2749.0059631565587:\\ \;\;\;\;\left((x \cdot y + z)_* - y \cdot x\right) - 1\\ \mathbf{else}:\\ \;\;\;\;\left((\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - {y}^{\left(\frac{-1}{3} + \frac{-2}{3}\right)} \cdot {x}^{\left(\frac{-1}{3} + \frac{-2}{3}\right)}\right) - 1\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.2
Target0
Herbie8.8
\[-1\]

Derivation

  1. Split input into 2 regimes
  2. if z < -3.97775270147107e-10 or 2749.0059631565587 < z

    1. Initial program 60.4

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

      \[\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. Using strategy rm
    5. Applied add-cube-cbrt61.0

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

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

      \[\leadsto \color{blue}{\left((\left(\frac{1}{x}\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{1}{z}\right))_* - {\left(y \cdot x\right)}^{\left(\frac{-1}{3} + \frac{-2}{3}\right)}\right) - 1}\]
    8. Using strategy rm
    9. Applied unpow-prod-down8.6

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

    if -3.97775270147107e-10 < z < 2749.0059631565587

    1. Initial program 30.0

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

      \[\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. Using strategy rm
    5. Applied add-cube-cbrt30.4

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

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

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

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

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

Runtime

Time bar (total: 56.9s)Debug logProfile

herbie shell --seed '#(1063313015 2771194459 1594909340 1344785158 2223560818 546365448)' 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

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