?

Average Error: 2.1 → 2.1
Time: 11.3s
Precision: binary64
Cost: 576

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.1
Target2.1
Herbie2.1
\[\frac{t}{\frac{z - y}{x - y}} \]

Derivation?

  1. Initial program 2.1

    \[\frac{x - y}{z - y} \cdot t \]
  2. Final simplification2.1

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

Alternatives

Alternative 1
Error23.2
Cost1636
\[\begin{array}{l} t_1 := t \cdot \frac{x}{z}\\ t_2 := x \cdot \frac{t}{z - y}\\ t_3 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{+203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+168}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+59}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{+30}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -220000:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-7}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+215}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+229}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error23.9
Cost1504
\[\begin{array}{l} t_1 := \frac{t}{\frac{z}{x}}\\ t_2 := x \cdot \frac{t}{z - y}\\ t_3 := y \cdot \frac{t}{y - z}\\ \mathbf{if}\;z \leq -8.2 \cdot 10^{+198}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+169}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+46}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{+30}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -920000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{-27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 0.00142:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error11.6
Cost1236
\[\begin{array}{l} t_1 := \frac{t}{\frac{z - y}{x}}\\ t_2 := t \cdot \frac{y}{y - z}\\ t_3 := \left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{if}\;t \leq -7.8 \cdot 10^{-125}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq -7.5 \cdot 10^{-192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-275}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-169}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-101}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error22.6
Cost1108
\[\begin{array}{l} t_1 := y \cdot \frac{t}{y - z}\\ t_2 := x \cdot \frac{t}{z - y}\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{-41}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{+54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+95}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error17.2
Cost977
\[\begin{array}{l} t_1 := \frac{t}{\frac{z}{x - y}}\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+108}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+45}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;z \leq -37000 \lor \neg \left(z \leq 4.6 \cdot 10^{-7}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]
Alternative 6
Error17.4
Cost976
\[\begin{array}{l} t_1 := \frac{t}{\frac{z - y}{x}}\\ \mathbf{if}\;x \leq -2.2 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+49}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;x \leq 1.46 \cdot 10^{+116}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+126}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error22.1
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+99}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 8
Error27.0
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.66 \cdot 10^{+98}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-60}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 9
Error25.8
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.66 \cdot 10^{+98}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+26}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 10
Error39.7
Cost64
\[t \]

Error

Reproduce?

herbie shell --seed 2023018 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

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

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