
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + 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 t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (/ x y) (- z t) t))
double code(double x, double y, double z, double t) {
return fma((x / y), (z - t), t);
}
function code(x, y, z, t) return fma(Float64(x / y), Float64(z - t), t) end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)
\end{array}
Initial program 97.4%
fma-define97.4%
Simplified97.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+29) (not (<= (/ x y) 50000.0))) (* x (/ (- z t) y)) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+29) || !((x / y) <= 50000.0)) {
tmp = x * ((z - t) / y);
} else {
tmp = t + ((x / 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 / y) <= (-5d+29)) .or. (.not. ((x / y) <= 50000.0d0))) then
tmp = x * ((z - t) / y)
else
tmp = t + ((x / y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+29) || !((x / y) <= 50000.0)) {
tmp = x * ((z - t) / y);
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+29) or not ((x / y) <= 50000.0): tmp = x * ((z - t) / y) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+29) || !(Float64(x / y) <= 50000.0)) tmp = Float64(x * Float64(Float64(z - t) / y)); else tmp = Float64(t + Float64(Float64(x / y) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e+29) || ~(((x / y) <= 50000.0))) tmp = x * ((z - t) / y); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+29], N[Not[LessEqual[N[(x / y), $MachinePrecision], 50000.0]], $MachinePrecision]], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+29} \lor \neg \left(\frac{x}{y} \leq 50000\right):\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -5.0000000000000001e29 or 5e4 < (/.f64 x y) Initial program 94.8%
associate-*l/89.8%
associate-/l*94.0%
fma-define94.0%
Simplified94.0%
clear-num93.9%
associate-/r/94.0%
Applied egg-rr94.0%
Taylor expanded in x around inf 90.7%
div-sub93.8%
Simplified93.8%
if -5.0000000000000001e29 < (/.f64 x y) < 5e4Initial program 99.9%
Taylor expanded in z around inf 96.2%
Final simplification95.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+29) (not (<= (/ x y) 1.0))) (* x (/ (- z t) y)) (+ t (* x (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+29) || !((x / y) <= 1.0)) {
tmp = x * ((z - t) / 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 (((x / y) <= (-5d+29)) .or. (.not. ((x / y) <= 1.0d0))) then
tmp = x * ((z - t) / 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 (((x / y) <= -5e+29) || !((x / y) <= 1.0)) {
tmp = x * ((z - t) / y);
} else {
tmp = t + (x * (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+29) or not ((x / y) <= 1.0): tmp = x * ((z - t) / y) else: tmp = t + (x * (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+29) || !(Float64(x / y) <= 1.0)) tmp = Float64(x * Float64(Float64(z - t) / 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 (((x / y) <= -5e+29) || ~(((x / y) <= 1.0))) tmp = x * ((z - t) / y); else tmp = t + (x * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+29], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.0]], $MachinePrecision]], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+29} \lor \neg \left(\frac{x}{y} \leq 1\right):\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.0000000000000001e29 or 1 < (/.f64 x y) Initial program 94.9%
associate-*l/89.9%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
clear-num92.5%
associate-/r/92.9%
Applied egg-rr92.9%
Taylor expanded in x around inf 89.6%
div-sub92.6%
Simplified92.6%
if -5.0000000000000001e29 < (/.f64 x y) < 1Initial program 99.9%
Taylor expanded in z around inf 88.3%
associate-/l*91.6%
Simplified91.6%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.02) (not (<= (/ x y) 1e-5))) (* x (/ (- z t) y)) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.02) || !((x / y) <= 1e-5)) {
tmp = x * ((z - t) / y);
} else {
tmp = t * (1.0 - (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 (((x / y) <= (-0.02d0)) .or. (.not. ((x / y) <= 1d-5))) then
tmp = x * ((z - t) / y)
else
tmp = t * (1.0d0 - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.02) || !((x / y) <= 1e-5)) {
tmp = x * ((z - t) / y);
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.02) or not ((x / y) <= 1e-5): tmp = x * ((z - t) / y) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.02) || !(Float64(x / y) <= 1e-5)) tmp = Float64(x * Float64(Float64(z - t) / y)); else tmp = Float64(t * Float64(1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -0.02) || ~(((x / y) <= 1e-5))) tmp = x * ((z - t) / y); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.02], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-5]], $MachinePrecision]], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.02 \lor \neg \left(\frac{x}{y} \leq 10^{-5}\right):\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0200000000000000004 or 1.00000000000000008e-5 < (/.f64 x y) Initial program 95.1%
associate-*l/89.1%
associate-/l*91.1%
fma-define91.2%
Simplified91.2%
clear-num90.9%
associate-/r/91.2%
Applied egg-rr91.2%
Taylor expanded in x around inf 87.4%
div-sub90.3%
Simplified90.3%
if -0.0200000000000000004 < (/.f64 x y) < 1.00000000000000008e-5Initial program 99.9%
Taylor expanded in z around 0 70.6%
mul-1-neg70.6%
*-commutative70.6%
associate-*l/82.1%
*-lft-identity82.1%
distribute-lft-neg-in82.1%
mul-1-neg82.1%
distribute-rgt-in82.1%
mul-1-neg82.1%
unsub-neg82.1%
Simplified82.1%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -0.02) (* x (/ z y)) (if (<= (/ x y) 1e-5) t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.02) {
tmp = x * (z / y);
} else if ((x / y) <= 1e-5) {
tmp = t;
} else {
tmp = (x / 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 / y) <= (-0.02d0)) then
tmp = x * (z / y)
else if ((x / y) <= 1d-5) then
tmp = t
else
tmp = (x / y) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.02) {
tmp = x * (z / y);
} else if ((x / y) <= 1e-5) {
tmp = t;
} else {
tmp = (x / y) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -0.02: tmp = x * (z / y) elif (x / y) <= 1e-5: tmp = t else: tmp = (x / y) * z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -0.02) tmp = Float64(x * Float64(z / y)); elseif (Float64(x / y) <= 1e-5) tmp = t; else tmp = Float64(Float64(x / y) * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -0.02) tmp = x * (z / y); elseif ((x / y) <= 1e-5) tmp = t; else tmp = (x / y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -0.02], N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-5], t, N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.02:\\
\;\;\;\;x \cdot \frac{z}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-5}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0200000000000000004Initial program 93.2%
associate-*l/91.9%
associate-/l*90.0%
fma-define90.0%
Simplified90.0%
clear-num89.9%
associate-/r/90.0%
Applied egg-rr90.0%
Taylor expanded in z around inf 56.2%
associate-*r/60.8%
Simplified60.8%
if -0.0200000000000000004 < (/.f64 x y) < 1.00000000000000008e-5Initial program 99.9%
Taylor expanded in x around 0 80.4%
if 1.00000000000000008e-5 < (/.f64 x y) Initial program 96.5%
associate-*l/87.1%
associate-/l*92.0%
fma-define92.0%
Simplified92.0%
clear-num91.5%
associate-/r/92.0%
Applied egg-rr92.0%
Taylor expanded in z around inf 55.7%
associate-*r/57.6%
Simplified57.6%
clear-num57.3%
un-div-inv57.4%
Applied egg-rr57.4%
associate-/r/61.0%
Applied egg-rr61.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.95e-20) (not (<= t 1.36e-68))) (* t (- 1.0 (/ x y))) (* (/ x y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.95e-20) || !(t <= 1.36e-68)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = (x / 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 ((t <= (-1.95d-20)) .or. (.not. (t <= 1.36d-68))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = (x / y) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.95e-20) || !(t <= 1.36e-68)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = (x / y) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.95e-20) or not (t <= 1.36e-68): tmp = t * (1.0 - (x / y)) else: tmp = (x / y) * z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.95e-20) || !(t <= 1.36e-68)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(Float64(x / y) * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.95e-20) || ~((t <= 1.36e-68))) tmp = t * (1.0 - (x / y)); else tmp = (x / y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.95e-20], N[Not[LessEqual[t, 1.36e-68]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-20} \lor \neg \left(t \leq 1.36 \cdot 10^{-68}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\end{array}
\end{array}
if t < -1.95000000000000004e-20 or 1.36000000000000003e-68 < t Initial program 99.9%
Taylor expanded in z around 0 72.7%
mul-1-neg72.7%
*-commutative72.7%
associate-*l/84.6%
*-lft-identity84.6%
distribute-lft-neg-in84.6%
mul-1-neg84.6%
distribute-rgt-in84.6%
mul-1-neg84.6%
unsub-neg84.6%
Simplified84.6%
if -1.95000000000000004e-20 < t < 1.36000000000000003e-68Initial program 93.6%
associate-*l/91.7%
associate-/l*91.9%
fma-define91.9%
Simplified91.9%
clear-num91.5%
associate-/r/91.9%
Applied egg-rr91.9%
Taylor expanded in z around inf 64.1%
associate-*r/64.2%
Simplified64.2%
clear-num63.8%
un-div-inv63.9%
Applied egg-rr63.9%
associate-/r/66.9%
Applied egg-rr66.9%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1700.0) (not (<= x 3.5e-63))) (* x (/ z y)) t))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1700.0) || !(x <= 3.5e-63)) {
tmp = 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 ((x <= (-1700.0d0)) .or. (.not. (x <= 3.5d-63))) then
tmp = 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 ((x <= -1700.0) || !(x <= 3.5e-63)) {
tmp = x * (z / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1700.0) or not (x <= 3.5e-63): tmp = x * (z / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1700.0) || !(x <= 3.5e-63)) tmp = Float64(x * Float64(z / y)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1700.0) || ~((x <= 3.5e-63))) tmp = x * (z / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1700.0], N[Not[LessEqual[x, 3.5e-63]], $MachinePrecision]], N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1700 \lor \neg \left(x \leq 3.5 \cdot 10^{-63}\right):\\
\;\;\;\;x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if x < -1700 or 3.50000000000000003e-63 < x Initial program 95.6%
associate-*l/78.3%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
clear-num97.3%
associate-/r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 49.0%
associate-*r/55.6%
Simplified55.6%
if -1700 < x < 3.50000000000000003e-63Initial program 99.9%
Taylor expanded in x around 0 64.5%
Final simplification59.2%
(FPCore (x y z t) :precision binary64 (+ t (* (/ x y) (- z t))))
double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - 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 + ((x / y) * (z - t))
end function
public static double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - t));
}
def code(x, y, z, t): return t + ((x / y) * (z - t))
function code(x, y, z, t) return Float64(t + Float64(Float64(x / y) * Float64(z - t))) end
function tmp = code(x, y, z, t) tmp = t + ((x / y) * (z - t)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{x}{y} \cdot \left(z - t\right)
\end{array}
Initial program 97.4%
Final simplification97.4%
(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.4%
Taylor expanded in x around 0 38.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (/ x y) (- z t)) t)))
(if (< z 2.759456554562692e-282)
t_1
(if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = ((x / y) * (z - t)) + t
if (z < 2.759456554562692d-282) then
tmp = t_1
else if (z < 2.326994450874436d-110) then
tmp = (x * ((z - t) / y)) + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x / y) * (z - t)) + t tmp = 0 if z < 2.759456554562692e-282: tmp = t_1 elif z < 2.326994450874436e-110: tmp = (x * ((z - t) / y)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x / y) * Float64(z - t)) + t) tmp = 0.0 if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = Float64(Float64(x * Float64(Float64(z - t) / y)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x / y) * (z - t)) + t; tmp = 0.0; if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = (x * ((z - t) / y)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[Less[z, 2.759456554562692e-282], t$95$1, If[Less[z, 2.326994450874436e-110], N[(N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z 689864138640673/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (/ x y) (- z t)) t) (if (< z 581748612718609/25000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t))))
(+ (* (/ x y) (- z t)) t))