\[\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32\]
Test:
FastMath dist3
Bits:
128 bits
Bits error versus d1
Bits error versus d2
Bits error versus d3
Time: 4.9 s
Input Error: 0.0
Output Error: 0.0
Log:
Profile: 🕒
\((d1 * \left(d2 + 37\right) + \left(d3 \cdot d1\right))_*\)
  1. Started with
    \[\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32\]
    0.0
  2. Applied simplify to get
    \[\color{red}{\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32} \leadsto \color{blue}{\left(\left(5 + d3\right) + \left(32 + d2\right)\right) \cdot d1}\]
    0.0
  3. Using strategy rm
    0.0
  4. Applied flip-+ to get
    \[\left(\left(5 + d3\right) + \color{red}{\left(32 + d2\right)}\right) \cdot d1 \leadsto \left(\left(5 + d3\right) + \color{blue}{\frac{{32}^2 - {d2}^2}{32 - d2}}\right) \cdot d1\]
    12.1
  5. Applied flip-+ to get
    \[\left(\color{red}{\left(5 + d3\right)} + \frac{{32}^2 - {d2}^2}{32 - d2}\right) \cdot d1 \leadsto \left(\color{blue}{\frac{{5}^2 - {d3}^2}{5 - d3}} + \frac{{32}^2 - {d2}^2}{32 - d2}\right) \cdot d1\]
    21.3
  6. Applied frac-add to get
    \[\color{red}{\left(\frac{{5}^2 - {d3}^2}{5 - d3} + \frac{{32}^2 - {d2}^2}{32 - d2}\right)} \cdot d1 \leadsto \color{blue}{\frac{\left({5}^2 - {d3}^2\right) \cdot \left(32 - d2\right) + \left(5 - d3\right) \cdot \left({32}^2 - {d2}^2\right)}{\left(5 - d3\right) \cdot \left(32 - d2\right)}} \cdot d1\]
    22.8
  7. Applied associate-*l/ to get
    \[\color{red}{\frac{\left({5}^2 - {d3}^2\right) \cdot \left(32 - d2\right) + \left(5 - d3\right) \cdot \left({32}^2 - {d2}^2\right)}{\left(5 - d3\right) \cdot \left(32 - d2\right)} \cdot d1} \leadsto \color{blue}{\frac{\left(\left({5}^2 - {d3}^2\right) \cdot \left(32 - d2\right) + \left(5 - d3\right) \cdot \left({32}^2 - {d2}^2\right)\right) \cdot d1}{\left(5 - d3\right) \cdot \left(32 - d2\right)}}\]
    25.9
  8. Applied simplify to get
    \[\frac{\color{red}{\left(\left({5}^2 - {d3}^2\right) \cdot \left(32 - d2\right) + \left(5 - d3\right) \cdot \left({32}^2 - {d2}^2\right)\right) \cdot d1}}{\left(5 - d3\right) \cdot \left(32 - d2\right)} \leadsto \frac{\color{blue}{d1 \cdot \left(\left(\left(32 - d2\right) \cdot \left(5 - d3\right)\right) \cdot \left(\left(5 + d3\right) + \left(d2 + 32\right)\right)\right)}}{\left(5 - d3\right) \cdot \left(32 - d2\right)}\]
    25.8
  9. Applied taylor to get
    \[\frac{d1 \cdot \left(\left(\left(32 - d2\right) \cdot \left(5 - d3\right)\right) \cdot \left(\left(5 + d3\right) + \left(d2 + 32\right)\right)\right)}{\left(5 - d3\right) \cdot \left(32 - d2\right)} \leadsto d1 \cdot d3 + \left(37 \cdot d1 + d1 \cdot d2\right)\]
    0.0
  10. Taylor expanded around 0 to get
    \[\color{red}{d1 \cdot d3 + \left(37 \cdot d1 + d1 \cdot d2\right)} \leadsto \color{blue}{d1 \cdot d3 + \left(37 \cdot d1 + d1 \cdot d2\right)}\]
    0.0
  11. Applied simplify to get
    \[d1 \cdot d3 + \left(37 \cdot d1 + d1 \cdot d2\right) \leadsto (d1 * \left(d2 + 37\right) + \left(d3 \cdot d1\right))_*\]
    0.0

  12. Applied final simplification

Original test:


(lambda ((d1 default) (d2 default) (d3 default))
  #:name "FastMath dist3"
  (+ (+ (* d1 d2) (* (+ d3 5) d1)) (* d1 32))
  #:target
  (* d1 (+ (+ 37 d3) d2)))