
(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;
}
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;
}
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 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]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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;
}
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;
}
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 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]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(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;
}
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;
}
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 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]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Initial program 96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.45e+19) (/ t (- 1.0 (/ z y))) (if (<= y 3.7e+50) (* t (/ x (- z y))) (/ (- t) (/ (- z y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.45e+19) {
tmp = t / (1.0 - (z / y));
} else if (y <= 3.7e+50) {
tmp = t * (x / (z - y));
} else {
tmp = -t / ((z - y) / y);
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-2.45d+19)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 3.7d+50) then
tmp = t * (x / (z - y))
else
tmp = -t / ((z - y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.45e+19) {
tmp = t / (1.0 - (z / y));
} else if (y <= 3.7e+50) {
tmp = t * (x / (z - y));
} else {
tmp = -t / ((z - y) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.45e+19: tmp = t / (1.0 - (z / y)) elif y <= 3.7e+50: tmp = t * (x / (z - y)) else: tmp = -t / ((z - y) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.45e+19) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 3.7e+50) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(Float64(-t) / Float64(Float64(z - y) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.45e+19) tmp = t / (1.0 - (z / y)); elseif (y <= 3.7e+50) tmp = t * (x / (z - y)); else tmp = -t / ((z - y) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.45e+19], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+50], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) / N[(N[(z - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{+19}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+50}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{z - y}{y}}\\
\end{array}
\end{array}
if y < -2.45e19Initial program 99.9%
Taylor expanded in x around 0 60.4%
mul-1-neg60.4%
associate-/l*85.0%
distribute-neg-frac85.0%
div-sub85.0%
*-inverses85.0%
Simplified85.0%
frac-2neg85.0%
div-inv85.0%
remove-double-neg85.0%
sub-neg85.0%
metadata-eval85.0%
distribute-neg-in85.0%
metadata-eval85.0%
Applied egg-rr85.0%
associate-*r/85.0%
*-rgt-identity85.0%
+-commutative85.0%
unsub-neg85.0%
Simplified85.0%
if -2.45e19 < y < 3.7000000000000001e50Initial program 93.8%
Taylor expanded in x around inf 78.4%
if 3.7000000000000001e50 < y Initial program 99.9%
associate-*l/66.3%
clear-num66.1%
Applied egg-rr66.1%
Taylor expanded in x around 0 56.1%
mul-1-neg56.1%
associate-/l*85.8%
distribute-neg-frac85.8%
Simplified85.8%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8e+20) (not (<= y 3e+50))) (/ t (- 1.0 (/ z y))) (* t (/ x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8e+20) || !(y <= 3e+50)) {
tmp = t / (1.0 - (z / y));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-8d+20)) .or. (.not. (y <= 3d+50))) then
tmp = t / (1.0d0 - (z / y))
else
tmp = t * (x / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8e+20) || !(y <= 3e+50)) {
tmp = t / (1.0 - (z / y));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8e+20) or not (y <= 3e+50): tmp = t / (1.0 - (z / y)) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8e+20) || !(y <= 3e+50)) tmp = Float64(t / Float64(1.0 - Float64(z / y))); else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8e+20) || ~((y <= 3e+50))) tmp = t / (1.0 - (z / y)); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8e+20], N[Not[LessEqual[y, 3e+50]], $MachinePrecision]], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+20} \lor \neg \left(y \leq 3 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -8e20 or 2.9999999999999998e50 < y Initial program 99.9%
Taylor expanded in x around 0 58.7%
mul-1-neg58.7%
associate-/l*85.3%
distribute-neg-frac85.3%
div-sub85.3%
*-inverses85.3%
Simplified85.3%
frac-2neg85.3%
div-inv85.3%
remove-double-neg85.3%
sub-neg85.3%
metadata-eval85.3%
distribute-neg-in85.3%
metadata-eval85.3%
Applied egg-rr85.3%
associate-*r/85.3%
*-rgt-identity85.3%
+-commutative85.3%
unsub-neg85.3%
Simplified85.3%
if -8e20 < y < 2.9999999999999998e50Initial program 93.8%
Taylor expanded in x around inf 78.4%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= y -4.3e+54) t (if (<= y 4e+67) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e+54) {
tmp = t;
} else if (y <= 4e+67) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-4.3d+54)) then
tmp = t
else if (y <= 4d+67) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e+54) {
tmp = t;
} else if (y <= 4e+67) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.3e+54: tmp = t elif y <= 4e+67: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.3e+54) tmp = t; elseif (y <= 4e+67) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.3e+54) tmp = t; elseif (y <= 4e+67) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.3e+54], t, If[LessEqual[y, 4e+67], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+54}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+67}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.29999999999999976e54 or 3.99999999999999993e67 < y Initial program 99.9%
Taylor expanded in y around inf 77.0%
if -4.29999999999999976e54 < y < 3.99999999999999993e67Initial program 94.5%
Taylor expanded in x around inf 71.7%
*-commutative71.7%
associate-*r/73.9%
Simplified73.9%
Final simplification75.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.02e+61) t (if (<= y 2.9e+68) (* t (/ x (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+61) {
tmp = t;
} else if (y <= 2.9e+68) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-1.02d+61)) then
tmp = t
else if (y <= 2.9d+68) then
tmp = t * (x / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+61) {
tmp = t;
} else if (y <= 2.9e+68) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e+61: tmp = t elif y <= 2.9e+68: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e+61) tmp = t; elseif (y <= 2.9e+68) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.02e+61) tmp = t; elseif (y <= 2.9e+68) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e+61], t, If[LessEqual[y, 2.9e+68], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+61}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+68}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.01999999999999999e61 or 2.90000000000000011e68 < y Initial program 99.9%
Taylor expanded in y around inf 78.3%
if -1.01999999999999999e61 < y < 2.90000000000000011e68Initial program 94.6%
Taylor expanded in x around inf 75.3%
Final simplification76.4%
(FPCore (x y z t) :precision binary64 (if (<= y -2.95e-100) t (if (<= y 3.5e+67) (* y (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.95e-100) {
tmp = t;
} else if (y <= 3.5e+67) {
tmp = y * (t / z);
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-2.95d-100)) then
tmp = t
else if (y <= 3.5d+67) then
tmp = y * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.95e-100) {
tmp = t;
} else if (y <= 3.5e+67) {
tmp = y * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.95e-100: tmp = t elif y <= 3.5e+67: tmp = y * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.95e-100) tmp = t; elseif (y <= 3.5e+67) tmp = Float64(y * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.95e-100) tmp = t; elseif (y <= 3.5e+67) tmp = y * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.95e-100], t, If[LessEqual[y, 3.5e+67], N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.95 \cdot 10^{-100}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+67}:\\
\;\;\;\;y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.9500000000000002e-100 or 3.5e67 < y Initial program 99.2%
Taylor expanded in y around inf 61.6%
if -2.9500000000000002e-100 < y < 3.5e67Initial program 93.6%
Taylor expanded in z around inf 73.2%
associate-/l*75.6%
Simplified75.6%
Taylor expanded in x around 0 25.7%
associate-*r/25.7%
mul-1-neg25.7%
distribute-rgt-neg-out25.7%
associate-*l/28.8%
Simplified28.8%
expm1-log1p-u25.9%
expm1-udef20.5%
*-commutative20.5%
clear-num20.5%
un-div-inv20.5%
add-sqr-sqrt6.6%
sqrt-unprod18.8%
sqr-neg18.8%
sqrt-unprod12.3%
add-sqr-sqrt19.7%
Applied egg-rr19.7%
expm1-def19.7%
expm1-log1p22.5%
associate-/l*18.8%
associate-*r/22.5%
Simplified22.5%
Final simplification43.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.02e+55) t (if (<= y 4.2e+69) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+55) {
tmp = t;
} else if (y <= 4.2e+69) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-1.02d+55)) then
tmp = t
else if (y <= 4.2d+69) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+55) {
tmp = t;
} else if (y <= 4.2e+69) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e+55: tmp = t elif y <= 4.2e+69: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e+55) tmp = t; elseif (y <= 4.2e+69) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.02e+55) tmp = t; elseif (y <= 4.2e+69) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e+55], t, If[LessEqual[y, 4.2e+69], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+55}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.02000000000000002e55 or 4.2000000000000003e69 < y Initial program 99.9%
Taylor expanded in y around inf 77.0%
if -1.02000000000000002e55 < y < 4.2000000000000003e69Initial program 94.5%
Taylor expanded in y around 0 56.2%
associate-/l*60.4%
associate-/r/57.2%
Simplified57.2%
Final simplification64.7%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e+54) t (if (<= y 4e+67) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+54) {
tmp = t;
} else if (y <= 4e+67) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-3.1d+54)) then
tmp = t
else if (y <= 4d+67) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+54) {
tmp = t;
} else if (y <= 4e+67) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e+54: tmp = t elif y <= 4e+67: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e+54) tmp = t; elseif (y <= 4e+67) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.1e+54) tmp = t; elseif (y <= 4e+67) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e+54], t, If[LessEqual[y, 4e+67], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+54}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.0999999999999999e54 or 3.99999999999999993e67 < y Initial program 99.9%
Taylor expanded in y around inf 77.0%
if -3.0999999999999999e54 < y < 3.99999999999999993e67Initial program 94.5%
Taylor expanded in y around 0 60.5%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return 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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 96.5%
Taylor expanded in y around inf 36.6%
Final simplification36.6%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2024018
(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))