
(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 (+ 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 98.3%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2000.0) (not (<= (/ x y) 2e-5))) (* (/ x y) (- t)) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2000.0) || !((x / y) <= 2e-5)) {
tmp = (x / y) * -t;
} 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 / y) <= (-2000.0d0)) .or. (.not. ((x / y) <= 2d-5))) then
tmp = (x / y) * -t
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 / y) <= -2000.0) || !((x / y) <= 2e-5)) {
tmp = (x / y) * -t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2000.0) or not ((x / y) <= 2e-5): tmp = (x / y) * -t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2000.0) || !(Float64(x / y) <= 2e-5)) tmp = Float64(Float64(x / y) * Float64(-t)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2000.0) || ~(((x / y) <= 2e-5))) tmp = (x / y) * -t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-5]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000 \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -2e3 or 2.00000000000000016e-5 < (/.f64 x y) Initial program 99.1%
Taylor expanded in z around 0 56.8%
*-rgt-identity56.8%
*-commutative56.8%
associate-*r/63.2%
associate-*r*63.2%
*-commutative63.2%
distribute-lft-in63.2%
mul-1-neg63.2%
unsub-neg63.2%
Simplified63.2%
Taylor expanded in x around inf 63.2%
mul-1-neg63.2%
distribute-frac-neg63.2%
Simplified63.2%
if -2e3 < (/.f64 x y) < 2.00000000000000016e-5Initial program 97.4%
Taylor expanded in x around 0 76.6%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2000.0) (/ (- t) (/ y x)) (if (<= (/ x y) 2e-5) t (* (/ x y) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2000.0) {
tmp = -t / (y / x);
} else if ((x / y) <= 2e-5) {
tmp = t;
} else {
tmp = (x / y) * -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 / y) <= (-2000.0d0)) then
tmp = -t / (y / x)
else if ((x / y) <= 2d-5) then
tmp = t
else
tmp = (x / y) * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2000.0) {
tmp = -t / (y / x);
} else if ((x / y) <= 2e-5) {
tmp = t;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2000.0: tmp = -t / (y / x) elif (x / y) <= 2e-5: tmp = t else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2000.0) tmp = Float64(Float64(-t) / Float64(y / x)); elseif (Float64(x / y) <= 2e-5) tmp = t; else tmp = Float64(Float64(x / y) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2000.0) tmp = -t / (y / x); elseif ((x / y) <= 2e-5) tmp = t; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2000.0], N[((-t) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-5], t, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000:\\
\;\;\;\;\frac{-t}{\frac{y}{x}}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -2e3Initial program 99.7%
Taylor expanded in z around 0 57.4%
*-rgt-identity57.4%
*-commutative57.4%
associate-*r/63.2%
associate-*r*63.2%
*-commutative63.2%
distribute-lft-in63.2%
mul-1-neg63.2%
unsub-neg63.2%
Simplified63.2%
Taylor expanded in x around inf 63.1%
mul-1-neg63.1%
distribute-frac-neg63.1%
Simplified63.1%
add-sqr-sqrt33.5%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod6.6%
add-sqr-sqrt8.9%
clear-num8.9%
div-inv8.9%
add-sqr-sqrt3.6%
sqrt-unprod29.2%
sqr-neg29.2%
sqrt-unprod29.8%
add-sqr-sqrt63.2%
distribute-neg-frac63.2%
Applied egg-rr63.2%
if -2e3 < (/.f64 x y) < 2.00000000000000016e-5Initial program 97.4%
Taylor expanded in x around 0 76.6%
if 2.00000000000000016e-5 < (/.f64 x y) Initial program 98.5%
Taylor expanded in z around 0 56.3%
*-rgt-identity56.3%
*-commutative56.3%
associate-*r/63.2%
associate-*r*63.2%
*-commutative63.2%
distribute-lft-in63.2%
mul-1-neg63.2%
unsub-neg63.2%
Simplified63.2%
Taylor expanded in x around inf 63.2%
mul-1-neg63.2%
distribute-frac-neg63.2%
Simplified63.2%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.7e-160) (not (<= x 1.85e-232))) (- t (* x (/ (- t z) y))) (+ t (/ (* x z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.7e-160) || !(x <= 1.85e-232)) {
tmp = t - (x * ((t - 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 ((x <= (-1.7d-160)) .or. (.not. (x <= 1.85d-232))) then
tmp = t - (x * ((t - 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 ((x <= -1.7e-160) || !(x <= 1.85e-232)) {
tmp = t - (x * ((t - z) / y));
} else {
tmp = t + ((x * z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.7e-160) or not (x <= 1.85e-232): tmp = t - (x * ((t - z) / y)) else: tmp = t + ((x * z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.7e-160) || !(x <= 1.85e-232)) tmp = Float64(t - Float64(x * Float64(Float64(t - z) / y))); else tmp = Float64(t + Float64(Float64(x * z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.7e-160) || ~((x <= 1.85e-232))) tmp = t - (x * ((t - z) / y)); else tmp = t + ((x * z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.7e-160], N[Not[LessEqual[x, 1.85e-232]], $MachinePrecision]], N[(t - N[(x * N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-160} \lor \neg \left(x \leq 1.85 \cdot 10^{-232}\right):\\
\;\;\;\;t - x \cdot \frac{t - z}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x \cdot z}{y}\\
\end{array}
\end{array}
if x < -1.70000000000000011e-160 or 1.84999999999999989e-232 < x Initial program 98.5%
Taylor expanded in x around 0 91.7%
associate-*r/96.4%
Simplified96.4%
if -1.70000000000000011e-160 < x < 1.84999999999999989e-232Initial program 97.4%
Taylor expanded in z around inf 95.8%
Final simplification96.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.5e+38) (not (<= t 1.28e+28))) (* t (- 1.0 (/ x y))) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e+38) || !(t <= 1.28e+28)) {
tmp = t * (1.0 - (x / 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 ((t <= (-5.5d+38)) .or. (.not. (t <= 1.28d+28))) then
tmp = t * (1.0d0 - (x / 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 ((t <= -5.5e+38) || !(t <= 1.28e+28)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.5e+38) or not (t <= 1.28e+28): tmp = t * (1.0 - (x / y)) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.5e+38) || !(t <= 1.28e+28)) tmp = Float64(t * Float64(1.0 - Float64(x / 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 ((t <= -5.5e+38) || ~((t <= 1.28e+28))) tmp = t * (1.0 - (x / y)); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.5e+38], N[Not[LessEqual[t, 1.28e+28]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+38} \lor \neg \left(t \leq 1.28 \cdot 10^{+28}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if t < -5.5000000000000003e38 or 1.28000000000000006e28 < t Initial program 99.9%
Taylor expanded in z around 0 85.4%
*-rgt-identity85.4%
*-commutative85.4%
associate-*r/92.4%
associate-*r*92.4%
*-commutative92.4%
distribute-lft-in92.4%
mul-1-neg92.4%
unsub-neg92.4%
Simplified92.4%
if -5.5000000000000003e38 < t < 1.28000000000000006e28Initial program 96.9%
Taylor expanded in z around inf 83.6%
associate-*l/86.8%
*-commutative86.8%
Simplified86.8%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.6e+39) (not (<= t 5.2e+27))) (- t (/ t (/ y x))) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.6e+39) || !(t <= 5.2e+27)) {
tmp = t - (t / (y / x));
} 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 ((t <= (-5.6d+39)) .or. (.not. (t <= 5.2d+27))) then
tmp = t - (t / (y / x))
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 ((t <= -5.6e+39) || !(t <= 5.2e+27)) {
tmp = t - (t / (y / x));
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.6e+39) or not (t <= 5.2e+27): tmp = t - (t / (y / x)) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.6e+39) || !(t <= 5.2e+27)) tmp = Float64(t - Float64(t / Float64(y / x))); 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 ((t <= -5.6e+39) || ~((t <= 5.2e+27))) tmp = t - (t / (y / x)); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.6e+39], N[Not[LessEqual[t, 5.2e+27]], $MachinePrecision]], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+39} \lor \neg \left(t \leq 5.2 \cdot 10^{+27}\right):\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if t < -5.60000000000000003e39 or 5.20000000000000018e27 < t Initial program 99.9%
Taylor expanded in z around 0 85.4%
mul-1-neg85.4%
associate-/l*92.5%
Simplified92.5%
if -5.60000000000000003e39 < t < 5.20000000000000018e27Initial program 96.9%
Taylor expanded in z around inf 83.6%
associate-*l/86.8%
*-commutative86.8%
Simplified86.8%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 5e+291) t (* (/ x y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 5e+291) {
tmp = t;
} else {
tmp = (x / y) * 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 / y) <= 5d+291) then
tmp = t
else
tmp = (x / y) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 5e+291) {
tmp = t;
} else {
tmp = (x / y) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 5e+291: tmp = t else: tmp = (x / y) * t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 5e+291) tmp = t; else tmp = Float64(Float64(x / y) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 5e+291) tmp = t; else tmp = (x / y) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 5e+291], t, N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 5 \cdot 10^{+291}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot t\\
\end{array}
\end{array}
if (/.f64 x y) < 5.0000000000000001e291Initial program 98.5%
Taylor expanded in x around 0 40.9%
if 5.0000000000000001e291 < (/.f64 x y) Initial program 95.3%
Taylor expanded in z around 0 58.7%
*-rgt-identity58.7%
*-commutative58.7%
associate-*r/69.0%
associate-*r*69.0%
*-commutative69.0%
distribute-lft-in69.0%
mul-1-neg69.0%
unsub-neg69.0%
Simplified69.0%
Taylor expanded in x around inf 69.0%
mul-1-neg69.0%
distribute-frac-neg69.0%
Simplified69.0%
*-commutative69.0%
remove-double-neg69.0%
frac-2neg69.0%
associate-/r/58.7%
frac-2neg58.7%
add-sqr-sqrt31.7%
sqrt-unprod37.4%
sqr-neg37.4%
sqrt-unprod0.3%
add-sqr-sqrt7.0%
distribute-frac-neg7.0%
remove-double-neg7.0%
Applied egg-rr7.0%
associate-/r/26.3%
Applied egg-rr26.3%
Final simplification39.8%
(FPCore (x y z t) :precision binary64 (* t (- 1.0 (/ x y))))
double code(double x, double y, double z, double t) {
return t * (1.0 - (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 * (1.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t * (1.0 - (x / y));
}
def code(x, y, z, t): return t * (1.0 - (x / y))
function code(x, y, z, t) return Float64(t * Float64(1.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t * (1.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(1 - \frac{x}{y}\right)
\end{array}
Initial program 98.3%
Taylor expanded in z around 0 65.1%
*-rgt-identity65.1%
*-commutative65.1%
associate-*r/69.9%
associate-*r*69.9%
*-commutative69.9%
distribute-lft-in69.9%
mul-1-neg69.9%
unsub-neg69.9%
Simplified69.9%
Final simplification69.9%
(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 98.3%
Taylor expanded in x around 0 37.9%
Final simplification37.9%
(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 2024034
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))