Average Error: 11.4 → 6.5
Time: 6.8s
Precision: 64
Internal Precision: 320
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;b1 \cdot b2 \le -1.0545201117055032 \cdot 10^{+184}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;b1 \cdot b2 \le -3.8220188897971772 \cdot 10^{-236}:\\ \;\;\;\;\frac{\frac{1}{b1}}{b2} \cdot \left(a2 \cdot a1\right)\\ \mathbf{elif}\;b1 \cdot b2 \le 2.0259147619971227 \cdot 10^{-296} \lor \neg \left(b1 \cdot b2 \le 23619375384618.953\right):\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{else}:\\ \;\;\;\;a1 \cdot \left(\frac{1}{b1 \cdot b2} \cdot a2\right)\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.4
Target11.3
Herbie6.5
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 4 regimes
  2. if (* b1 b2) < -1.0545201117055032e+184

    1. Initial program 16.3

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification4.9

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

    if -1.0545201117055032e+184 < (* b1 b2) < -3.8220188897971772e-236

    1. Initial program 4.5

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied div-inv4.5

      \[\leadsto \color{blue}{\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}}\]
    4. Using strategy rm
    5. Applied associate-/r*4.5

      \[\leadsto \left(a1 \cdot a2\right) \cdot \color{blue}{\frac{\frac{1}{b1}}{b2}}\]

    if -3.8220188897971772e-236 < (* b1 b2) < 2.0259147619971227e-296 or 23619375384618.953 < (* b1 b2)

    1. Initial program 17.1

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

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

    if 2.0259147619971227e-296 < (* b1 b2) < 23619375384618.953

    1. Initial program 6.3

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied div-inv6.4

      \[\leadsto \color{blue}{\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}}\]
    4. Using strategy rm
    5. Applied associate-*l*6.2

      \[\leadsto \color{blue}{a1 \cdot \left(a2 \cdot \frac{1}{b1 \cdot b2}\right)}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification6.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;b1 \cdot b2 \le -1.0545201117055032 \cdot 10^{+184}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;b1 \cdot b2 \le -3.8220188897971772 \cdot 10^{-236}:\\ \;\;\;\;\frac{\frac{1}{b1}}{b2} \cdot \left(a2 \cdot a1\right)\\ \mathbf{elif}\;b1 \cdot b2 \le 2.0259147619971227 \cdot 10^{-296} \lor \neg \left(b1 \cdot b2 \le 23619375384618.953\right):\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{else}:\\ \;\;\;\;a1 \cdot \left(\frac{1}{b1 \cdot b2} \cdot a2\right)\\ \end{array}\]

Runtime

Time bar (total: 6.8s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes11.56.50.011.443.5%
herbie shell --seed 2018295 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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