Average Error: 2.0 → 2.0
Time: 11.4s
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.0
Target2.0
Herbie2.0
\[\frac{t}{\frac{z - y}{x - y}} \]

Derivation

  1. Initial program 2.0

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

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

Alternatives

Alternative 1
Error18.0
Cost1108
\[\begin{array}{l} t_1 := y \cdot \frac{t}{y - z}\\ t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -5 \cdot 10^{+142}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-14}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-95}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-53}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error19.4
Cost976
\[\begin{array}{l} t_1 := y \cdot \frac{t}{y - z}\\ \mathbf{if}\;y \leq -6.1 \cdot 10^{+140}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-25}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+138}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 3
Error25.7
Cost848
\[\begin{array}{l} \mathbf{if}\;y \leq -1.45:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-20}:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-47}:\\ \;\;\;\;\frac{y \cdot t}{y}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-53}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 4
Error25.7
Cost848
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-20}:\\ \;\;\;\;x \cdot \frac{-t}{y}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-48}:\\ \;\;\;\;\frac{y \cdot t}{y}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-54}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 5
Error6.8
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+143}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+153}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
Alternative 6
Error22.6
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -3.6:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 7
Error17.3
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{-94}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-55}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]
Alternative 8
Error17.4
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-94}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-57}:\\ \;\;\;\;\frac{x}{\frac{z - y}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]
Alternative 9
Error25.7
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.72 \cdot 10^{-53}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 10
Error25.2
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-54}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 11
Error25.2
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-54}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 12
Error40.1
Cost64
\[t \]

Error

Reproduce

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