Average Error: 7.8 → 5.4
Time: 45.1s
Precision: 64
Internal Precision: 576
$z \cdot \left(\frac{x}{y} - \frac{y}{x}\right)$
$\begin{array}{l} \mathbf{if}\;z \cdot \left(\frac{x}{y} - \frac{y}{x}\right) \le -1.7794315695230746 \cdot 10^{+308}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot x}\\ \mathbf{if}\;z \cdot \left(\frac{x}{y} - \frac{y}{x}\right) \le 1.7788245908354802 \cdot 10^{+308}:\\ \;\;\;\;z \cdot \left(\frac{x}{y} - \frac{y}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot x}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if (* z (- (/ x y) (/ y x))) < -1.7794315695230746e+308 or 1.7788245908354802e+308 < (* z (- (/ x y) (/ y x)))

1. Initial program 60.0

$z \cdot \left(\frac{x}{y} - \frac{y}{x}\right)$
2. Using strategy rm
3. Applied frac-sub60.0

$\leadsto z \cdot \color{blue}{\frac{x \cdot x - y \cdot y}{y \cdot x}}$
4. Applied associate-*r/41.0

$\leadsto \color{blue}{\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot x}}$

## if -1.7794315695230746e+308 < (* z (- (/ x y) (/ y x))) < 1.7788245908354802e+308

1. Initial program 0.3

$z \cdot \left(\frac{x}{y} - \frac{y}{x}\right)$
3. Recombined 2 regimes into one program.

# Runtime

Time bar (total: 45.1s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (z x y)
:name "z*(x/y-y/x)"
(* z (- (/ x y) (/ y x))))