Average Error: 6.8 → 1.3
Time: 3.4s
Precision: binary64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \leq -3.2274220469820457 \cdot 10^{-196} \lor \neg \left(x \leq 1.1367150419428766 \cdot 10^{-154}\right):\\ \;\;\;\;x + \frac{1}{\frac{\frac{t}{y}}{z - x}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \left(\frac{z - x}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{t}}\right)\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;x \leq -3.2274220469820457 \cdot 10^{-196} \lor \neg \left(x \leq 1.1367150419428766 \cdot 10^{-154}\right):\\
\;\;\;\;x + \frac{1}{\frac{\frac{t}{y}}{z - x}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \left(\frac{z - x}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{t}}\right)\\

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (x + (((double) (y * ((double) (z - x)))) / t)));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((x <= -3.2274220469820457e-196) || !(x <= 1.1367150419428766e-154))) {
		VAR = ((double) (x + (1.0 / ((t / y) / ((double) (z - x))))));
	} else {
		VAR = ((double) (x + ((double) ((((double) (((double) cbrt(y)) * ((double) cbrt(y)))) / ((double) cbrt(t))) * ((double) ((((double) (z - x)) / ((double) cbrt(t))) * (((double) cbrt(y)) / ((double) cbrt(t)))))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.8
Target2.0
Herbie1.3
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 2 regimes
  2. if x < -3.2274220469820457e-196 or 1.1367150419428766e-154 < x

    1. Initial program 7.1

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied clear-num7.1

      \[\leadsto x + \color{blue}{\frac{1}{\frac{t}{y \cdot \left(z - x\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/r*1.0

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

    if -3.2274220469820457e-196 < x < 1.1367150419428766e-154

    1. Initial program 6.0

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt6.7

      \[\leadsto x + \frac{y \cdot \left(z - x\right)}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
    4. Applied times-frac4.7

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt4.9

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\]
    7. Applied times-frac4.9

      \[\leadsto x + \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{t}}\right)} \cdot \frac{z - x}{\sqrt[3]{t}}\]
    8. Applied associate-*l*2.2

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\right)}\]
    9. Simplified2.2

      \[\leadsto x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \color{blue}{\left(\frac{z - x}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{t}}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.2274220469820457 \cdot 10^{-196} \lor \neg \left(x \leq 1.1367150419428766 \cdot 10^{-154}\right):\\ \;\;\;\;x + \frac{1}{\frac{\frac{t}{y}}{z - x}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \left(\frac{z - x}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{t}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020196 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

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