?

Average Error: 0.0 → 0.0
Time: 13.9s
Precision: binary64
Cost: 832

?

\[x + \left(y - z\right) \cdot \left(t - x\right) \]
\[x + \left(\left(y - z\right) \cdot t - \left(y - z\right) \cdot x\right) \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
(FPCore (x y z t) :precision binary64 (+ x (- (* (- y z) t) (* (- y z) x))))
double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
double code(double x, double y, double z, double t) {
	return x + (((y - z) * t) - ((y - 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) * (t - x))
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 - z) * t) - ((y - z) * x))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
public static double code(double x, double y, double z, double t) {
	return x + (((y - z) * t) - ((y - z) * x));
}
def code(x, y, z, t):
	return x + ((y - z) * (t - x))
def code(x, y, z, t):
	return x + (((y - z) * t) - ((y - z) * x))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - z) * Float64(t - x)))
end
function code(x, y, z, t)
	return Float64(x + Float64(Float64(Float64(y - z) * t) - Float64(Float64(y - z) * x)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - z) * (t - x));
end
function tmp = code(x, y, z, t)
	tmp = x + (((y - z) * t) - ((y - z) * x));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y - z\right) \cdot \left(t - x\right)
x + \left(\left(y - z\right) \cdot t - \left(y - z\right) \cdot x\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right) \]

Derivation?

  1. Initial program 0.0

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Applied egg-rr0.0

    \[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot t - \left(y - z\right) \cdot x\right)} \]
  3. Final simplification0.0

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

Alternatives

Alternative 1
Error10.2
Cost976
\[\begin{array}{l} t_1 := x + z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 10^{-104}:\\ \;\;\;\;y \cdot \left(t - x\right) + x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+15}:\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+18}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error18.4
Cost912
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := z \cdot \left(-t\right) + x\\ \mathbf{if}\;y \leq -0.085:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-175}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-92}:\\ \;\;\;\;y \cdot t + x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error22.5
Cost848
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := y \cdot t + x\\ \mathbf{if}\;y \leq -1.9 \cdot 10^{+41}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-145}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{-141}:\\ \;\;\;\;\left(1 + z\right) \cdot x\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error22.5
Cost848
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := y \cdot t + x\\ \mathbf{if}\;y \leq -1.9 \cdot 10^{+41}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-146}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-141}:\\ \;\;\;\;z \cdot x + x\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error40.8
Cost784
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+79}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-26}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-64}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{+57}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Error40.9
Cost720
\[\begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{+84}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{-27}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{-63}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+30}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error13.8
Cost712
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{+37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+48}:\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error11.9
Cost712
\[\begin{array}{l} t_1 := x + t \cdot \left(y - z\right)\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{-32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.32 \cdot 10^{-86}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error28.5
Cost584
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -8 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error22.1
Cost584
\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\ \;\;\;\;\left(1 + z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error0.0
Cost576
\[x + \left(y - z\right) \cdot \left(t - x\right) \]
Alternative 12
Error40.8
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -0.00025:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-58}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 13
Error47.6
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023101 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

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

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