Average Error: 11.1 → 2.5
Time: 33.9s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{a2}{b2}}{b1} \le -9.815105028843137 \cdot 10^{+227}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;\frac{\frac{a2}{b2}}{b1} \le -6.270049032267763 \cdot 10^{-270}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b2}}{b1}\\ \mathbf{if}\;\frac{\frac{a2}{b2}}{b1} \le 4.947781671806845 \cdot 10^{-296}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;\frac{\frac{a2}{b2}}{b1} \le 4.528110892709925 \cdot 10^{+306}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b2}}{b1}\\ \mathbf{else}:\\ \;\;\;\;\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\\ \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.1
Target11.1
Herbie2.5
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (/ a2 b2) b1) < -9.815105028843137e+227 or -6.270049032267763e-270 < (/ (/ a2 b2) b1) < 4.947781671806845e-296

    1. Initial program 8.4

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

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

    if -9.815105028843137e+227 < (/ (/ a2 b2) b1) < -6.270049032267763e-270 or 4.947781671806845e-296 < (/ (/ a2 b2) b1) < 4.528110892709925e+306

    1. Initial program 12.5

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

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

      \[\leadsto \color{blue}{a1 \cdot \left(a2 \cdot \frac{1}{b1 \cdot b2}\right)}\]
    6. Applied simplify0.5

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

    if 4.528110892709925e+306 < (/ (/ a2 b2) b1)

    1. Initial program 11.8

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

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

Runtime

Time bar (total: 33.9s)Debug logProfile

herbie shell --seed 2018201 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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