Average Error: 45.0 → 27.0
Time: 1.8m
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 -2.4667992782576733 \cdot 10^{+20}:\\ \;\;\;\;\log \left(e^{\left(\left((x \cdot y + z)_* - \frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right)}{y \cdot x - z}\right) + \frac{z \cdot z}{y \cdot x - z}\right) + \left(-1\right)}\right)\\ \mathbf{if}\;z \le 8.263724872421754 \cdot 10^{+74}:\\ \;\;\;\;\log \left(e^{\left((x \cdot y + z)_* - \frac{y \cdot x}{1} \cdot \frac{y \cdot x}{y \cdot x - z}\right) + \left(\frac{z \cdot z}{y \cdot x - z} - 1\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\left(\left((x \cdot y + z)_* - \frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right)}{y \cdot x - z}\right) + \frac{z \cdot z}{y \cdot x - z}\right) + \left(-1\right)}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.0
Target0
Herbie27.0
\[-1\]

Derivation

  1. Split input into 2 regimes
  2. if z < -2.4667992782576733e+20 or 8.263724872421754e+74 < z

    1. Initial program 62.2

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

      \[\leadsto (x \cdot y + z)_* - \left(1 + \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right) - z \cdot z}{x \cdot y - z}}\right)\]
    4. Using strategy rm
    5. Applied div-sub62.7

      \[\leadsto (x \cdot y + z)_* - \left(1 + \color{blue}{\left(\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}{x \cdot y - z} - \frac{z \cdot z}{x \cdot y - z}\right)}\right)\]
    6. Applied associate-+r-62.7

      \[\leadsto (x \cdot y + z)_* - \color{blue}{\left(\left(1 + \frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}{x \cdot y - z}\right) - \frac{z \cdot z}{x \cdot y - z}\right)}\]
    7. Applied associate--r-62.7

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

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

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

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

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

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

      \[\leadsto \log \color{blue}{\left(e^{\left((x \cdot y + z)_* - \frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right)}{y \cdot x - z}\right) + \left(\frac{z \cdot z}{y \cdot x - z} - 1\right)}\right)}\]
    15. Using strategy rm
    16. Applied sub-neg62.3

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

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

    if -2.4667992782576733e+20 < z < 8.263724872421754e+74

    1. Initial program 32.4

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

      \[\leadsto (x \cdot y + z)_* - \left(1 + \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right) - z \cdot z}{x \cdot y - z}}\right)\]
    4. Using strategy rm
    5. Applied div-sub32.7

      \[\leadsto (x \cdot y + z)_* - \left(1 + \color{blue}{\left(\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}{x \cdot y - z} - \frac{z \cdot z}{x \cdot y - z}\right)}\right)\]
    6. Applied associate-+r-32.7

      \[\leadsto (x \cdot y + z)_* - \color{blue}{\left(\left(1 + \frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}{x \cdot y - z}\right) - \frac{z \cdot z}{x \cdot y - z}\right)}\]
    7. Applied associate--r-32.7

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

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

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

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

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

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

      \[\leadsto \log \color{blue}{\left(e^{\left((x \cdot y + z)_* - \frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right)}{y \cdot x - z}\right) + \left(\frac{z \cdot z}{y \cdot x - z} - 1\right)}\right)}\]
    15. Using strategy rm
    16. Applied *-un-lft-identity22.0

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

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

Runtime

Time bar (total: 1.8m)Debug logProfile

herbie shell --seed '#(1063185673 2139736501 2393378123 1907444849 1070993796 1007244912)' 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

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