Average Error: 10.6 → 10.6
Time: 59.2s
Precision: binary64
Cost: 704
\[\frac{x - y \cdot z}{t - a \cdot z}\]
\[\frac{x - y \cdot z}{t - z \cdot a}\]
\frac{x - y \cdot z}{t - a \cdot z}
\frac{x - y \cdot z}{t - z \cdot a}
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* z a))))
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (z * a));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.6
Target2.0
Herbie10.6
\[\begin{array}{l} \mathbf{if}\;z < -32113435955957344:\\ \;\;\;\;\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t - a \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}\\ \end{array}\]
Alternative 1
Accuracy27.7
Cost1481
\[\begin{array}{l} \mathbf{if}\;t \leq -2.4718391855306994 \cdot 10^{+57} \lor \neg \left(t \leq -1.443750134220221 \cdot 10^{-37} \lor \neg \left(t \leq 2.9603802216467987 \cdot 10^{-68}\right) \land t \leq 1.2241118948661996 \cdot 10^{+96}\right):\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - z \cdot y}{\sqrt[3]{{\left(t - z \cdot a\right)}^{3}}}\\ \end{array}\]
Alternative 2
Accuracy37.6
Cost896
\[\frac{x - y \cdot z}{\sqrt[3]{{\left(t - z \cdot a\right)}^{3}}}\]

Derivation

  1. Initial program 10.6

    \[\frac{x - y \cdot z}{t - a \cdot z}\]
  2. Using strategy rm
  3. Applied sub-neg_binary64_1780310.6

    \[\leadsto \frac{x - y \cdot z}{\color{blue}{t + \left(-a \cdot z\right)}}\]
  4. Simplified10.6

    \[\leadsto \frac{x - y \cdot z}{t + \color{blue}{\left(-z \cdot a\right)}}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity_binary64_1781010.6

    \[\leadsto \color{blue}{1 \cdot \frac{x - y \cdot z}{t + \left(-z \cdot a\right)}}\]
  7. Using strategy rm
  8. Applied sub-neg_binary64_1780310.6

    \[\leadsto 1 \cdot \frac{\color{blue}{x + \left(-y \cdot z\right)}}{t + \left(-z \cdot a\right)}\]
  9. Using strategy rm
  10. Applied unsub-neg_binary64_1780410.6

    \[\leadsto 1 \cdot \frac{x + \left(-y \cdot z\right)}{\color{blue}{t - z \cdot a}}\]
  11. Final simplification10.6

    \[\leadsto \frac{x - y \cdot z}{t - z \cdot a}\]

Reproduce

herbie shell --seed 2020322 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))

  (/ (- x (* y z)) (- t (* a z))))