Average Error: 14.1 → 1.0
Time: 17.9s
Precision: 64
Internal precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -6.4042332376573255 \cdot 10^{+208}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -1.2665794875040561 \cdot 10^{-228}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -0.0:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le 8.240287997287591 \cdot 10^{+264}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}\]
Derivation
- Split input into 3 regimes.
-
if (/ (* (/ y z) t) t) < -6.4042332376573255e+208 or -1.2665794875040561e-228 < (/ (* (/ y z) t) t) < -0.0 or 8.240287997287591e+264 < (/ (* (/ y z) t) t)
Initial program 34.3
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
Applied simplify 14.6
\[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
Applied taylor 1.9
\[\leadsto \frac{y \cdot x}{z}\]
Taylor expanded around 0 1.9
\[\leadsto \color{blue}{\frac{y \cdot x}{z}}\]
if -6.4042332376573255e+208 < (/ (* (/ y z) t) t) < -1.2665794875040561e-228
Initial program 0.5
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
Applied simplify 0.2
\[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
if -0.0 < (/ (* (/ y z) t) t) < 8.240287997287591e+264
Initial program 0.7
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
Applied simplify 0.5
\[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
- Using strategy
rm
Applied div-inv 0.6
\[\leadsto \color{blue}{x \cdot \frac{1}{\frac{z}{y}}}\]
Applied simplify 0.3
\[\leadsto x \cdot \color{blue}{\frac{y}{z}}\]
- Recombined 3 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie --seed '#(1783572468 3863613768 3512785497 430809791 1767835035 1415167301)'
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
(* x (/ (* (/ y z) t) t)))