Average Error: 11.0 → 10.9
Time: 26.5s
Precision: 64
Internal Precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
↓
\[\begin{array}{l}
\mathbf{if}\;a2 \le -1.338280974594955 \cdot 10^{-60}:\\
\;\;\;\;\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}\\
\mathbf{if}\;a2 \le 1.196555386697209 \cdot 10^{-255}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{if}\;a2 \le 2.4020301758630992 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\
\mathbf{if}\;a2 \le 1.503214291414168 \cdot 10^{-24}:\\
\;\;\;\;{\left(\frac{a1}{b2} \cdot \frac{a2}{b1}\right)}^{1}\\
\mathbf{if}\;a2 \le 1.079801262456853 \cdot 10^{+83}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{if}\;a2 \le 2.4095681903393743 \cdot 10^{+212}:\\
\;\;\;\;{\left(\frac{a1}{b2} \cdot \frac{a2}{b1}\right)}^{1}\\
\mathbf{if}\;a2 \le 1.2890961211188752 \cdot 10^{+295}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\end{array}\]
Target
| Original | 11.0 |
|---|
| Target | 11.1 |
|---|
| Herbie | 10.9 |
|---|
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]
Derivation
- Split input into 5 regimes
if a2 < -1.338280974594955e-60
Initial program 11.8
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied clear-num12.1
\[\leadsto \color{blue}{\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}}\]
if -1.338280974594955e-60 < a2 < 1.196555386697209e-255 or 1.2890961211188752e+295 < a2
Initial program 10.4
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied times-frac10.6
\[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
if 1.196555386697209e-255 < a2 < 2.4020301758630992e-111
Initial program 10.0
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied associate-/r*10.6
\[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]
if 2.4020301758630992e-111 < a2 < 1.503214291414168e-24 or 1.079801262456853e+83 < a2 < 2.4095681903393743e+212
Initial program 10.7
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied div-inv10.9
\[\leadsto \color{blue}{\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}}\]
- Using strategy
rm Applied pow110.9
\[\leadsto \left(a1 \cdot a2\right) \cdot \color{blue}{{\left(\frac{1}{b1 \cdot b2}\right)}^{1}}\]
Applied pow110.9
\[\leadsto \color{blue}{{\left(a1 \cdot a2\right)}^{1}} \cdot {\left(\frac{1}{b1 \cdot b2}\right)}^{1}\]
Applied pow-prod-down10.9
\[\leadsto \color{blue}{{\left(\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\right)}^{1}}\]
Applied simplify9.9
\[\leadsto {\color{blue}{\left(\frac{a1}{b2} \cdot \frac{a2}{b1}\right)}}^{1}\]
if 1.503214291414168e-24 < a2 < 1.079801262456853e+83 or 2.4095681903393743e+212 < a2 < 1.2890961211188752e+295
Initial program 12.1
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied associate-/l*11.2
\[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]
- Recombined 5 regimes into one program.
- Removed slow
pow expressions.
Runtime
herbie shell --seed '#(1063282112 2455465480 4141627379 3773598652 1647277307 776739644)'
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))