Average Error: 14.1 → 2.5
Time: 18.0s
Precision: 64
Internal Precision: 384
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -4.602470990660421 \cdot 10^{+196}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -4.277841604952349 \cdot 10^{-152}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le 1.0095648996456092 \cdot 10^{-196}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Split input into 2 regimes
  2. if (/ (* (/ y z) t) t) < -4.602470990660421e+196 or -4.277841604952349e-152 < (/ (* (/ y z) t) t) < 1.0095648996456092e-196

    1. Initial program 23.5

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Applied simplify9.8

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    3. Taylor expanded around 0 1.8

      \[\leadsto \color{blue}{\frac{y \cdot x}{z}}\]
    4. Using strategy rm
    5. Applied associate-/l*1.9

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}}\]

    if -4.602470990660421e+196 < (/ (* (/ y z) t) t) < -4.277841604952349e-152 or 1.0095648996456092e-196 < (/ (* (/ y z) t) t)

    1. Initial program 6.4

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Applied simplify2.7

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    3. Using strategy rm
    4. Applied div-inv3.0

      \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{z}{y}}}\]
    5. Applied simplify2.9

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 18.0s)Debug logProfile

herbie shell --seed '#(1063282112 2455465480 4141627379 3773598652 1647277307 776739644)' 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  (* x (/ (* (/ y z) t) t)))