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

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.8
Target1.1
Herbie1.1
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Alternatives

Alternative 1
Error2.6
Cost2370
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -7.380950953897127 \cdot 10^{+261}:\\ \;\;\;\;\frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 1.1343626169164683 \cdot 10^{+303}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \end{array}\]
Alternative 2
Error8.1
Cost1218
\[\begin{array}{l} \mathbf{if}\;t \leq -1.3818246021427278 \cdot 10^{+76}:\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \mathbf{elif}\;t \leq 5.803292953563066 \cdot 10^{+31}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\ \end{array}\]
Alternative 3
Error8.0
Cost1218
\[\begin{array}{l} \mathbf{if}\;t \leq -1.102174851064985 \cdot 10^{+76}:\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \mathbf{elif}\;t \leq 2.8220827675284874:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\ \end{array}\]
Alternative 4
Error8.0
Cost904
\[\begin{array}{l} \mathbf{if}\;t \leq -2.7455690387719104 \cdot 10^{+76} \lor \neg \left(t \leq 1456.7049171416834\right):\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \end{array}\]
Alternative 5
Error10.4
Cost904
\[\begin{array}{l} \mathbf{if}\;t \leq -4.080211441867023 \cdot 10^{+131} \lor \neg \left(t \leq 7.837503083522533 \cdot 10^{+32}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \end{array}\]
Alternative 6
Error14.0
Cost776
\[\begin{array}{l} \mathbf{if}\;t \leq -2.680276939493432 \cdot 10^{+44} \lor \neg \left(t \leq 7.667158584379091 \cdot 10^{+30}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \end{array}\]
Alternative 7
Error14.7
Cost776
\[\begin{array}{l} \mathbf{if}\;t \leq -1.0035685746638153 \cdot 10^{+37} \lor \neg \left(t \leq 9.698361597559374 \cdot 10^{+30}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \end{array}\]
Alternative 8
Error20.1
Cost2118
\[\begin{array}{l} \mathbf{if}\;t \leq -6.8116282335522364 \cdot 10^{-12}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6.801950263694391 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -9.403135936280139 \cdot 10^{-266}:\\ \;\;\;\;\frac{y \cdot z}{a - t}\\ \mathbf{elif}\;t \leq 9.658743010715143 \cdot 10^{-290}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.300288683503237 \cdot 10^{-281}:\\ \;\;\;\;\frac{y \cdot z}{a - t}\\ \mathbf{elif}\;t \leq 4.918021197517231 \cdot 10^{+30}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array}\]
Alternative 9
Error19.5
Cost520
\[\begin{array}{l} \mathbf{if}\;t \leq -9.67240256475412 \cdot 10^{-13} \lor \neg \left(t \leq 7.086814866327582 \cdot 10^{+30}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 10
Error28.5
Cost64
\[x\]
Alternative 11
Error61.8
Cost64
\[-1\]
Alternative 12
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 10.8

    \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
  2. Using strategy rm
  3. Applied associate-/l*_binary64_105941.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
  4. Simplified1.1

    \[\leadsto \color{blue}{x + \frac{y}{\frac{a - t}{z - t}}}\]
  5. Final simplification1.1

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

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