Average Error: 10.9 → 10.5
Time: 6.7s
Precision: 64
Internal precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a2 \le -1.3325061181107773 \cdot 10^{+217}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\ \mathbf{if}\;a2 \le -4.969955314137239 \cdot 10^{-254}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{if}\;a2 \le 1.5686396626431321 \cdot 10^{-35}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\ \mathbf{if}\;a2 \le 1.975073998090622 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

Original10.9
Comparison10.8
Herbie10.5
\[ \frac{a1}{b1} \cdot \frac{a2}{b2} \]

Derivation

  1. Split input into 4 regimes.
  2. if a2 < -1.3325061181107773e+217 or -4.969955314137239e-254 < a2 < 1.5686396626431321e-35

    1. Initial program 11.2

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

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
    4. Using strategy rm
    5. Applied div-inv 10.6

      \[\leadsto \color{blue}{\left(a1 \cdot \frac{1}{b1}\right)} \cdot \frac{a2}{b2}\]
    6. Applied associate-*l* 10.8

      \[\leadsto \color{blue}{a1 \cdot \left(\frac{1}{b1} \cdot \frac{a2}{b2}\right)}\]
    7. Applied simplify 11.0

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

    if -1.3325061181107773e+217 < a2 < -4.969955314137239e-254

    1. Initial program 9.4

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]

    if 1.5686396626431321e-35 < a2 < 1.975073998090622e+166

    1. Initial program 10.0

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

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

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

    if 1.975073998090622e+166 < a2

    1. Initial program 18.8

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

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
  3. Recombined 4 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 6.7s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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