Average Error: 11.0 → 2.8
Time: 28.5s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{a1}{b1} \cdot a2 \le -4.400783426764326 \cdot 10^{+202}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;\frac{a1}{b1} \cdot a2 \le -3.630518211079796 \cdot 10^{-288}:\\ \;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\ \mathbf{if}\;\frac{a1}{b1} \cdot a2 \le 4.758519206875224 \cdot 10^{-309}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;\frac{a1}{b1} \cdot a2 \le 8.44930068305971 \cdot 10^{+182}:\\ \;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

Original11.0
Target10.8
Herbie2.8
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 2 regimes
  2. if (* (/ a1 b1) a2) < -4.400783426764326e+202 or -3.630518211079796e-288 < (* (/ a1 b1) a2) < 4.758519206875224e-309 or 8.44930068305971e+182 < (* (/ a1 b1) a2)

    1. Initial program 9.8

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/l*5.8

      \[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]

    if -4.400783426764326e+202 < (* (/ a1 b1) a2) < -3.630518211079796e-288 or 4.758519206875224e-309 < (* (/ a1 b1) a2) < 8.44930068305971e+182

    1. Initial program 11.9

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied times-frac7.1

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
    4. Using strategy rm
    5. Applied associate-*r/0.5

      \[\leadsto \color{blue}{\frac{\frac{a1}{b1} \cdot a2}{b2}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 28.5s)Debug logProfile

herbie shell --seed '#(1071821486 549052472 3784827256 1559736200 3548510075 881134285)' 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

  :herbie-target
  (* (/ a1 b1) (/ a2 b2))

  (/ (* a1 a2) (* b1 b2)))