
(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 97.7%
(FPCore (x y z t) :precision binary64 (if (<= y -8.2e+93) (* t (/ y (- y z))) (if (<= y 1.4e+183) (* (- x y) (/ t (- z y))) (* t (/ (- y x) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+93) {
tmp = t * (y / (y - z));
} else if (y <= 1.4e+183) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * ((y - x) / 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 <= (-8.2d+93)) then
tmp = t * (y / (y - z))
else if (y <= 1.4d+183) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * ((y - x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+93) {
tmp = t * (y / (y - z));
} else if (y <= 1.4e+183) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e+93: tmp = t * (y / (y - z)) elif y <= 1.4e+183: tmp = (x - y) * (t / (z - y)) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e+93) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 1.4e+183) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e+93) tmp = t * (y / (y - z)); elseif (y <= 1.4e+183) tmp = (x - y) * (t / (z - y)); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e+93], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+183], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+93}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+183}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -8.2000000000000002e93Initial program 99.9%
Taylor expanded in x around 0 89.1%
neg-mul-189.1%
distribute-neg-frac289.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Simplified89.1%
if -8.2000000000000002e93 < y < 1.40000000000000009e183Initial program 96.7%
associate-*l/92.1%
associate-/l*93.0%
Simplified93.0%
if 1.40000000000000009e183 < y Initial program 99.9%
Taylor expanded in z around 0 87.7%
associate-*r/87.7%
neg-mul-187.7%
neg-sub087.7%
sub-neg87.7%
+-commutative87.7%
associate--r+87.7%
neg-sub087.7%
remove-double-neg87.7%
Simplified87.7%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.55e-10) (not (<= x 1.95e-13))) (* t (/ x (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.55e-10) || !(x <= 1.95e-13)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
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 ((x <= (-1.55d-10)) .or. (.not. (x <= 1.95d-13))) then
tmp = t * (x / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.55e-10) || !(x <= 1.95e-13)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.55e-10) or not (x <= 1.95e-13): tmp = t * (x / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.55e-10) || !(x <= 1.95e-13)) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.55e-10) || ~((x <= 1.95e-13))) tmp = t * (x / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.55e-10], N[Not[LessEqual[x, 1.95e-13]], $MachinePrecision]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-10} \lor \neg \left(x \leq 1.95 \cdot 10^{-13}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -1.55000000000000008e-10 or 1.95000000000000002e-13 < x Initial program 97.5%
Taylor expanded in x around inf 73.8%
if -1.55000000000000008e-10 < x < 1.95000000000000002e-13Initial program 97.8%
Taylor expanded in x around 0 86.4%
neg-mul-186.4%
distribute-neg-frac286.4%
neg-sub086.4%
sub-neg86.4%
+-commutative86.4%
associate--r+86.4%
neg-sub086.4%
remove-double-neg86.4%
Simplified86.4%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= x -5.5e-11) (* t (/ x (- z y))) (if (<= x 2.1e-13) (* t (/ y (- y z))) (/ t (/ (- z y) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.5e-11) {
tmp = t * (x / (z - y));
} else if (x <= 2.1e-13) {
tmp = t * (y / (y - z));
} else {
tmp = t / ((z - y) / x);
}
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 (x <= (-5.5d-11)) then
tmp = t * (x / (z - y))
else if (x <= 2.1d-13) then
tmp = t * (y / (y - z))
else
tmp = t / ((z - y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.5e-11) {
tmp = t * (x / (z - y));
} else if (x <= 2.1e-13) {
tmp = t * (y / (y - z));
} else {
tmp = t / ((z - y) / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.5e-11: tmp = t * (x / (z - y)) elif x <= 2.1e-13: tmp = t * (y / (y - z)) else: tmp = t / ((z - y) / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.5e-11) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (x <= 2.1e-13) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t / Float64(Float64(z - y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.5e-11) tmp = t * (x / (z - y)); elseif (x <= 2.1e-13) tmp = t * (y / (y - z)); else tmp = t / ((z - y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.5e-11], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e-13], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-11}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\end{array}
\end{array}
if x < -5.49999999999999975e-11Initial program 98.4%
Taylor expanded in x around inf 72.4%
if -5.49999999999999975e-11 < x < 2.09999999999999989e-13Initial program 97.8%
Taylor expanded in x around 0 86.4%
neg-mul-186.4%
distribute-neg-frac286.4%
neg-sub086.4%
sub-neg86.4%
+-commutative86.4%
associate--r+86.4%
neg-sub086.4%
remove-double-neg86.4%
Simplified86.4%
if 2.09999999999999989e-13 < x Initial program 96.5%
associate-*l/86.1%
associate-/l*85.9%
Simplified85.9%
associate-*r/86.1%
associate-*l/96.5%
*-commutative96.5%
clear-num96.4%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in x around inf 75.4%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.7e+51) t (if (<= y 4.5e+70) (* t (/ x (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.7e+51) {
tmp = t;
} else if (y <= 4.5e+70) {
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 <= (-3.7d+51)) then
tmp = t
else if (y <= 4.5d+70) 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 <= -3.7e+51) {
tmp = t;
} else if (y <= 4.5e+70) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.7e+51: tmp = t elif y <= 4.5e+70: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.7e+51) tmp = t; elseif (y <= 4.5e+70) 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 <= -3.7e+51) tmp = t; elseif (y <= 4.5e+70) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.7e+51], t, If[LessEqual[y, 4.5e+70], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+51}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+70}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.7000000000000002e51 or 4.4999999999999999e70 < y Initial program 99.9%
associate-*l/75.7%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in y around inf 65.7%
if -3.7000000000000002e51 < y < 4.4999999999999999e70Initial program 95.9%
Taylor expanded in x around inf 70.9%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= y -2.9e+26) t (if (<= y 4.2e+70) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e+26) {
tmp = t;
} else if (y <= 4.2e+70) {
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 <= (-2.9d+26)) then
tmp = t
else if (y <= 4.2d+70) 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 <= -2.9e+26) {
tmp = t;
} else if (y <= 4.2e+70) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.9e+26: tmp = t elif y <= 4.2e+70: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.9e+26) tmp = t; elseif (y <= 4.2e+70) 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 <= -2.9e+26) tmp = t; elseif (y <= 4.2e+70) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e+26], t, If[LessEqual[y, 4.2e+70], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+26}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+70}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.9e26 or 4.20000000000000015e70 < y Initial program 99.9%
associate-*l/77.3%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in y around inf 64.0%
if -2.9e26 < y < 4.20000000000000015e70Initial program 95.7%
associate-*l/93.6%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in x around inf 71.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2.65e+26) t (if (<= y 4.9e+70) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.65e+26) {
tmp = t;
} else if (y <= 4.9e+70) {
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 <= (-2.65d+26)) then
tmp = t
else if (y <= 4.9d+70) 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 <= -2.65e+26) {
tmp = t;
} else if (y <= 4.9e+70) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.65e+26: tmp = t elif y <= 4.9e+70: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.65e+26) tmp = t; elseif (y <= 4.9e+70) 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 <= -2.65e+26) tmp = t; elseif (y <= 4.9e+70) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.65e+26], t, If[LessEqual[y, 4.9e+70], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+26}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+70}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.64999999999999984e26 or 4.90000000000000028e70 < y Initial program 99.9%
associate-*l/77.3%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in y around inf 64.0%
if -2.64999999999999984e26 < y < 4.90000000000000028e70Initial program 95.7%
Taylor expanded in y around 0 61.2%
Final simplification62.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e+26) t (if (<= y 4.7e+70) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e+26) {
tmp = t;
} else if (y <= 4.7e+70) {
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 <= (-2.5d+26)) then
tmp = t
else if (y <= 4.7d+70) 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 <= -2.5e+26) {
tmp = t;
} else if (y <= 4.7e+70) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e+26: tmp = t elif y <= 4.7e+70: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e+26) tmp = t; elseif (y <= 4.7e+70) 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 <= -2.5e+26) tmp = t; elseif (y <= 4.7e+70) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e+26], t, If[LessEqual[y, 4.7e+70], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+26}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+70}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.5e26 or 4.6999999999999998e70 < y Initial program 99.9%
associate-*l/77.3%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in y around inf 64.0%
if -2.5e26 < y < 4.6999999999999998e70Initial program 95.7%
associate-*l/93.6%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in x around inf 71.1%
Taylor expanded in z around inf 60.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 97.7%
associate-*l/85.9%
associate-/l*83.4%
Simplified83.4%
Taylor expanded in y around inf 35.9%
(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 2024170
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))