
(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 10 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 (/ (- z t) (/ y x))))
double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
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 - t) / (y / x))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
def code(x, y, z, t): return t + ((z - t) / (y / x))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) / Float64(y / x))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) / (y / x)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{z - t}{\frac{y}{x}}
\end{array}
Initial program 98.0%
Taylor expanded in x around 0 91.6%
*-commutative91.6%
associate-/l*98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+15) (not (<= (/ x y) 1e-85))) (+ t (* x (/ (- z t) y))) (+ t (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+15) || !((x / y) <= 1e-85)) {
tmp = t + (x * ((z - t) / y));
} 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 / y) <= (-2d+15)) .or. (.not. ((x / y) <= 1d-85))) then
tmp = t + (x * ((z - t) / y))
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 / y) <= -2e+15) || !((x / y) <= 1e-85)) {
tmp = t + (x * ((z - t) / y));
} else {
tmp = t + (z / (y / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+15) or not ((x / y) <= 1e-85): tmp = t + (x * ((z - t) / y)) else: tmp = t + (z / (y / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+15) || !(Float64(x / y) <= 1e-85)) tmp = Float64(t + Float64(x * Float64(Float64(z - t) / y))); else tmp = Float64(t + Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+15) || ~(((x / y) <= 1e-85))) tmp = t + (x * ((z - t) / y)); else tmp = t + (z / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+15], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-85]], $MachinePrecision]], N[(t + N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+15} \lor \neg \left(\frac{x}{y} \leq 10^{-85}\right):\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e15 or 9.9999999999999998e-86 < (/.f64 x y) Initial program 96.8%
Taylor expanded in x around 0 87.4%
associate-*r/95.5%
Simplified95.5%
if -2e15 < (/.f64 x y) < 9.9999999999999998e-86Initial program 99.9%
Taylor expanded in z around inf 97.4%
*-commutative97.4%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
*-commutative94.6%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification97.0%
(FPCore (x y z t) :precision binary64 (if (<= z -2e-78) (+ t (/ z (/ y x))) (if (<= z 1.25e-43) (+ t (/ t (/ (- y) x))) (+ t (* z (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-78) {
tmp = t + (z / (y / x));
} else if (z <= 1.25e-43) {
tmp = t + (t / (-y / x));
} else {
tmp = t + (z * (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 (z <= (-2d-78)) then
tmp = t + (z / (y / x))
else if (z <= 1.25d-43) then
tmp = t + (t / (-y / x))
else
tmp = t + (z * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-78) {
tmp = t + (z / (y / x));
} else if (z <= 1.25e-43) {
tmp = t + (t / (-y / x));
} else {
tmp = t + (z * (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e-78: tmp = t + (z / (y / x)) elif z <= 1.25e-43: tmp = t + (t / (-y / x)) else: tmp = t + (z * (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e-78) tmp = Float64(t + Float64(z / Float64(y / x))); elseif (z <= 1.25e-43) tmp = Float64(t + Float64(t / Float64(Float64(-y) / x))); else tmp = Float64(t + Float64(z * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e-78) tmp = t + (z / (y / x)); elseif (z <= 1.25e-43) tmp = t + (t / (-y / x)); else tmp = t + (z * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e-78], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-43], N[(t + N[(t / N[((-y) / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-78}:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-43}:\\
\;\;\;\;t + \frac{t}{\frac{-y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -2e-78Initial program 98.5%
Taylor expanded in z around inf 83.2%
*-commutative83.2%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
*-commutative84.4%
associate-/r/88.2%
Applied egg-rr88.2%
if -2e-78 < z < 1.25000000000000005e-43Initial program 96.5%
Taylor expanded in z around 0 83.2%
mul-1-neg83.2%
*-commutative83.2%
associate-*l/88.6%
distribute-rgt-neg-out88.6%
Simplified88.6%
add-sqr-sqrt44.6%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod22.6%
add-sqr-sqrt45.4%
clear-num45.4%
associate-*l/45.4%
*-un-lft-identity45.4%
frac-2neg45.4%
add-sqr-sqrt22.8%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod43.8%
add-sqr-sqrt89.3%
distribute-neg-frac89.3%
Applied egg-rr89.3%
if 1.25000000000000005e-43 < z Initial program 99.9%
Taylor expanded in z around inf 84.9%
associate-*l/92.8%
*-commutative92.8%
Simplified92.8%
Final simplification89.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.6e-167) (not (<= z 3.2e-49))) (+ t (* z (/ x y))) (- t (/ (* t x) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.6e-167) || !(z <= 3.2e-49)) {
tmp = t + (z * (x / y));
} else {
tmp = t - ((t * 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 ((z <= (-5.6d-167)) .or. (.not. (z <= 3.2d-49))) then
tmp = t + (z * (x / y))
else
tmp = t - ((t * x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.6e-167) || !(z <= 3.2e-49)) {
tmp = t + (z * (x / y));
} else {
tmp = t - ((t * x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.6e-167) or not (z <= 3.2e-49): tmp = t + (z * (x / y)) else: tmp = t - ((t * x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.6e-167) || !(z <= 3.2e-49)) tmp = Float64(t + Float64(z * Float64(x / y))); else tmp = Float64(t - Float64(Float64(t * x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.6e-167) || ~((z <= 3.2e-49))) tmp = t + (z * (x / y)); else tmp = t - ((t * x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.6e-167], N[Not[LessEqual[z, 3.2e-49]], $MachinePrecision]], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-167} \lor \neg \left(z \leq 3.2 \cdot 10^{-49}\right):\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t \cdot x}{y}\\
\end{array}
\end{array}
if z < -5.59999999999999971e-167 or 3.20000000000000002e-49 < z Initial program 98.7%
Taylor expanded in z around inf 82.1%
associate-*l/87.9%
*-commutative87.9%
Simplified87.9%
if -5.59999999999999971e-167 < z < 3.20000000000000002e-49Initial program 96.9%
Taylor expanded in z around 0 87.1%
mul-1-neg87.1%
*-commutative87.1%
Simplified87.1%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.1e-165) (not (<= z 1.32e-48))) (+ t (* z (/ x y))) (- t (* x (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.1e-165) || !(z <= 1.32e-48)) {
tmp = t + (z * (x / y));
} else {
tmp = t - (x * (t / 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 ((z <= (-5.1d-165)) .or. (.not. (z <= 1.32d-48))) then
tmp = t + (z * (x / y))
else
tmp = t - (x * (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.1e-165) || !(z <= 1.32e-48)) {
tmp = t + (z * (x / y));
} else {
tmp = t - (x * (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.1e-165) or not (z <= 1.32e-48): tmp = t + (z * (x / y)) else: tmp = t - (x * (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.1e-165) || !(z <= 1.32e-48)) tmp = Float64(t + Float64(z * Float64(x / y))); else tmp = Float64(t - Float64(x * Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.1e-165) || ~((z <= 1.32e-48))) tmp = t + (z * (x / y)); else tmp = t - (x * (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.1e-165], N[Not[LessEqual[z, 1.32e-48]], $MachinePrecision]], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{-165} \lor \neg \left(z \leq 1.32 \cdot 10^{-48}\right):\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t - x \cdot \frac{t}{y}\\
\end{array}
\end{array}
if z < -5.1e-165 or 1.32e-48 < z Initial program 98.7%
Taylor expanded in z around inf 82.6%
associate-*l/88.3%
*-commutative88.3%
Simplified88.3%
if -5.1e-165 < z < 1.32e-48Initial program 96.9%
Taylor expanded in x around 0 92.4%
*-commutative92.4%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
associate-*l/88.4%
distribute-rgt-neg-in88.4%
Simplified88.4%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1e-77) (+ t (/ z (/ y x))) (if (<= z 7.4e-44) (- t (* t (/ x y))) (+ t (* z (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e-77) {
tmp = t + (z / (y / x));
} else if (z <= 7.4e-44) {
tmp = t - (t * (x / y));
} else {
tmp = t + (z * (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 (z <= (-1d-77)) then
tmp = t + (z / (y / x))
else if (z <= 7.4d-44) then
tmp = t - (t * (x / y))
else
tmp = t + (z * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e-77) {
tmp = t + (z / (y / x));
} else if (z <= 7.4e-44) {
tmp = t - (t * (x / y));
} else {
tmp = t + (z * (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1e-77: tmp = t + (z / (y / x)) elif z <= 7.4e-44: tmp = t - (t * (x / y)) else: tmp = t + (z * (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1e-77) tmp = Float64(t + Float64(z / Float64(y / x))); elseif (z <= 7.4e-44) tmp = Float64(t - Float64(t * Float64(x / y))); else tmp = Float64(t + Float64(z * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1e-77) tmp = t + (z / (y / x)); elseif (z <= 7.4e-44) tmp = t - (t * (x / y)); else tmp = t + (z * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e-77], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e-44], N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-77}:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-44}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -9.9999999999999993e-78Initial program 98.5%
Taylor expanded in z around inf 83.2%
*-commutative83.2%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
*-commutative84.4%
associate-/r/88.2%
Applied egg-rr88.2%
if -9.9999999999999993e-78 < z < 7.4e-44Initial program 96.5%
Taylor expanded in z around 0 83.2%
mul-1-neg83.2%
*-commutative83.2%
associate-*l/88.6%
distribute-rgt-neg-out88.6%
Simplified88.6%
if 7.4e-44 < z Initial program 99.9%
Taylor expanded in z around inf 84.9%
associate-*l/92.8%
*-commutative92.8%
Simplified92.8%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (+ t (* (- z t) (/ x y))))
double code(double x, double y, double z, double t) {
return t + ((z - t) * (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 - t) * (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) * (x / y));
}
def code(x, y, z, t): return t + ((z - t) * (x / y))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) * Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) * (x / y)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \left(z - t\right) \cdot \frac{x}{y}
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (+ t (* x (/ z y))))
double code(double x, double y, double z, double t) {
return t + (x * (z / 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 + (x * (z / y))
end function
public static double code(double x, double y, double z, double t) {
return t + (x * (z / y));
}
def code(x, y, z, t): return t + (x * (z / y))
function code(x, y, z, t) return Float64(t + Float64(x * Float64(z / y))) end
function tmp = code(x, y, z, t) tmp = t + (x * (z / y)); end
code[x_, y_, z_, t_] := N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + x \cdot \frac{z}{y}
\end{array}
Initial program 98.0%
Taylor expanded in z around inf 72.2%
*-commutative72.2%
associate-*l/72.9%
*-commutative72.9%
Simplified72.9%
Final simplification72.9%
(FPCore (x y z t) :precision binary64 (+ t (* z (/ x y))))
double code(double x, double y, double z, double t) {
return t + (z * (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 * (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t + (z * (x / y));
}
def code(x, y, z, t): return t + (z * (x / y))
function code(x, y, z, t) return Float64(t + Float64(z * Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t + (z * (x / y)); end
code[x_, y_, z_, t_] := N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + z \cdot \frac{x}{y}
\end{array}
Initial program 98.0%
Taylor expanded in z around inf 72.2%
associate-*l/76.2%
*-commutative76.2%
Simplified76.2%
Final simplification76.2%
(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.0%
Taylor expanded in z around inf 72.2%
*-commutative72.2%
associate-*l/72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in x around 0 38.8%
Final simplification38.8%
(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 2024031
(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))