?

Average Accuracy: 90.0% → 96.7%
Time: 10.9s
Precision: binary64
Cost: 576

?

\[x + \frac{y \cdot \left(z - x\right)}{t} \]
\[x + \frac{y}{t} \cdot \left(z - x\right) \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t) :precision binary64 (+ x (* (/ y t) (- z x))))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
double code(double x, double y, double z, double t) {
	return x + ((y / t) * (z - x));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y / t) * (z - x))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
public static double code(double x, double y, double z, double t) {
	return x + ((y / t) * (z - x));
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
def code(x, y, z, t):
	return x + ((y / t) * (z - x))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y / t) * Float64(z - x)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
function tmp = code(x, y, z, t)
	tmp = x + ((y / t) * (z - x));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - x\right)}{t}
x + \frac{y}{t} \cdot \left(z - x\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original90.0%
Target96.7%
Herbie96.7%
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right) \]

Derivation?

  1. Initial program 90.0%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Simplified96.7%

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

    [Start]90.0

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

    associate-*l/ [<=]96.7

    \[ x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
  3. Final simplification96.7%

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

Alternatives

Alternative 1
Accuracy63.0%
Cost1241
\[\begin{array}{l} t_1 := y \cdot \frac{z - x}{t}\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-106}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-143}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-37}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 36000000000000 \lor \neg \left(y \leq 5.2 \cdot 10^{+125}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 2
Accuracy63.5%
Cost1240
\[\begin{array}{l} t_1 := \frac{y}{t} \cdot \left(z - x\right)\\ t_2 := y \cdot \frac{z - x}{t}\\ \mathbf{if}\;y \leq -8 \cdot 10^{+15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-51}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+125}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Accuracy82.5%
Cost976
\[\begin{array}{l} t_1 := x + \frac{y \cdot z}{t}\\ t_2 := x - x \cdot \frac{y}{t}\\ \mathbf{if}\;x \leq -1.96 \cdot 10^{+15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.25 \cdot 10^{-233}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-284}:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Accuracy82.5%
Cost976
\[\begin{array}{l} t_1 := x + \frac{y \cdot z}{t}\\ \mathbf{if}\;x \leq -5.4 \cdot 10^{+15}:\\ \;\;\;\;x - x \cdot \frac{y}{t}\\ \mathbf{elif}\;x \leq -4.1 \cdot 10^{-234}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-284}:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+16}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{y}}\\ \end{array} \]
Alternative 5
Accuracy82.8%
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+27} \lor \neg \left(y \leq 5 \cdot 10^{+125}\right):\\ \;\;\;\;y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array} \]
Alternative 6
Accuracy59.0%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-162}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-118}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Accuracy59.5%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{-80}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{-116}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Accuracy50.4%
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023137 
(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)))