\[\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20\]
Test:
FastMath test2
Bits:
128 bits
Bits error versus d1
Bits error versus d2
Time: 3.8 s
Input Error: 0.2
Output Error: 0.0
Log:
Profile: 🕒
\(d1 \cdot \left(d2 + 30\right)\)
  1. Started with
    \[\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20\]
    0.2
  2. Applied simplify to get
    \[\color{red}{\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20} \leadsto \color{blue}{(d1 * \left(20 + 10\right) + \left(d1 \cdot d2\right))_*}\]
    0.0
  3. Using strategy rm
    0.0
  4. Applied fma-udef to get
    \[\color{red}{(d1 * \left(20 + 10\right) + \left(d1 \cdot d2\right))_*} \leadsto \color{blue}{d1 \cdot \left(20 + 10\right) + d1 \cdot d2}\]
    0.0
  5. Applied taylor to get
    \[d1 \cdot \left(20 + 10\right) + d1 \cdot d2 \leadsto 30 \cdot d1 + d1 \cdot d2\]
    0.0
  6. Taylor expanded around 0 to get
    \[\color{red}{30 \cdot d1 + d1 \cdot d2} \leadsto \color{blue}{30 \cdot d1 + d1 \cdot d2}\]
    0.0
  7. Applied simplify to get
    \[\color{red}{30 \cdot d1 + d1 \cdot d2} \leadsto \color{blue}{d1 \cdot \left(d2 + 30\right)}\]
    0.0

  8. Removed slow pow expressions

Original test:


(lambda ((d1 default) (d2 default))
  #:name "FastMath test2"
  (+ (+ (* d1 10) (* d1 d2)) (* d1 20))
  #:target
  (* d1 (+ 30 d2)))