Average Error: 6.1 → 1.5
Time: 4.0s
Precision: binary64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -27905895958591340:\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{elif}\;t \le 1.56451213094456709 \cdot 10^{92}:\\ \;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;t \le -27905895958591340:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\

\mathbf{elif}\;t \le 1.56451213094456709 \cdot 10^{92}:\\
\;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((t <= -2.790589595859134e+16)) {
		VAR = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
	} else {
		double VAR_1;
		if ((t <= 1.564512130944567e+92)) {
			VAR_1 = ((double) (x + ((double) (1.0 / ((double) (t / ((double) (y * ((double) (z - x))))))))));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (y / ((double) (((double) cbrt(t)) * ((double) cbrt(t)))))) * ((double) (((double) (z - x)) / ((double) cbrt(t))))))));
		}
		VAR = VAR_1;
	}
	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.1
Target2.0
Herbie1.5
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 3 regimes
  2. if t < -27905895958591340

    1. Initial program 9.1

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

      \[\leadsto x + \frac{y \cdot \left(z - x\right)}{\color{blue}{1 \cdot t}}\]
    4. Applied times-frac1.0

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - x}{t}}\]
    5. Simplified1.0

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

    if -27905895958591340 < t < 1.56451213094456709e92

    1. Initial program 2.0

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{t}{y \cdot \left(z - x\right)}}}\]

    if 1.56451213094456709e92 < t

    1. Initial program 10.7

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

      \[\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-frac1.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -27905895958591340:\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{elif}\;t \le 1.56451213094456709 \cdot 10^{92}:\\ \;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020162 
(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)) (* (neg z) (/ y t))))

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