Average Error: 44.8 → 11.4
Time: 27.7s
Precision: 64
Internal precision: 128
\[(x * y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.6343379528750245 \cdot 10^{+107}:\\ \;\;\;\;\log \left(e^{\log \left(e^{\left((x * y + z)_* - y \cdot x\right) - z}\right) - 1}\right)\\ \mathbf{if}\;z \le 3.5909170849577044 \cdot 10^{+153}:\\ \;\;\;\;\log \left(e^{\left(\left((x * y + z)_* - z\right) - y \cdot x\right) - 1}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\log \left(e^{\left((x * y + z)_* - y \cdot x\right) - z}\right) - 1}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.8
Comparison0
Herbie11.4
\[ -1 \]

Derivation

  1. Split input into 2 regimes.
  2. if z < -1.6343379528750245e+107 or 3.5909170849577044e+153 < z

    1. Initial program 62.2

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

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

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

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

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

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

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

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

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

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

    if -1.6343379528750245e+107 < z < 3.5909170849577044e+153

    1. Initial program 37.6

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

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

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

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

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

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

Runtime

Time bar (total: 27.7s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3908633808 2562648389 2047445097 1738294998 1031207515 2011371258)'
(FPCore (x y z)
  :name "simple fma test"

  :target
  -1

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