
(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 11 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 97.4%
Final simplification97.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -3000000.0)
(/ t (/ y (- x)))
(if (<= (/ x y) -1e-88)
(/ (* x z) y)
(if (<= (/ x y) 5e-62) t (* (/ x y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -3000000.0) {
tmp = t / (y / -x);
} else if ((x / y) <= -1e-88) {
tmp = (x * z) / y;
} else if ((x / y) <= 5e-62) {
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) <= (-3000000.0d0)) then
tmp = t / (y / -x)
else if ((x / y) <= (-1d-88)) then
tmp = (x * z) / y
else if ((x / y) <= 5d-62) 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) <= -3000000.0) {
tmp = t / (y / -x);
} else if ((x / y) <= -1e-88) {
tmp = (x * z) / y;
} else if ((x / y) <= 5e-62) {
tmp = t;
} else {
tmp = (x / y) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -3000000.0: tmp = t / (y / -x) elif (x / y) <= -1e-88: tmp = (x * z) / y elif (x / y) <= 5e-62: tmp = t else: tmp = (x / y) * z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -3000000.0) tmp = Float64(t / Float64(y / Float64(-x))); elseif (Float64(x / y) <= -1e-88) tmp = Float64(Float64(x * z) / y); elseif (Float64(x / y) <= 5e-62) 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) <= -3000000.0) tmp = t / (y / -x); elseif ((x / y) <= -1e-88) tmp = (x * z) / y; elseif ((x / y) <= 5e-62) tmp = t; else tmp = (x / y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -3000000.0], N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1e-88], N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-62], t, N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3000000:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\
\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-88}:\\
\;\;\;\;\frac{x \cdot z}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-62}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -3e6Initial program 94.4%
Taylor expanded in z around 0 62.6%
mul-1-neg62.6%
*-rgt-identity62.6%
associate-/l*64.0%
distribute-rgt-neg-in64.0%
mul-1-neg64.0%
distribute-lft-in64.0%
mul-1-neg64.0%
unsub-neg64.0%
Simplified64.0%
Taylor expanded in x around inf 62.7%
mul-1-neg62.7%
distribute-frac-neg262.7%
Simplified62.7%
distribute-frac-neg262.7%
distribute-rgt-neg-in62.7%
clear-num62.7%
div-inv62.9%
distribute-neg-frac62.9%
Applied egg-rr62.9%
if -3e6 < (/.f64 x y) < -9.99999999999999934e-89Initial program 99.7%
add-cube-cbrt98.0%
associate-*l*98.1%
fma-define98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 61.2%
if -9.99999999999999934e-89 < (/.f64 x y) < 5.0000000000000002e-62Initial program 97.2%
Taylor expanded in x around 0 75.6%
if 5.0000000000000002e-62 < (/.f64 x y) Initial program 99.8%
add-cube-cbrt99.1%
associate-*l*99.2%
fma-define99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 66.3%
associate-*l/74.7%
*-commutative74.7%
Simplified74.7%
Final simplification70.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -3000000.0)
(* (/ x y) (- t))
(if (<= (/ x y) -1e-88)
(/ (* x z) y)
(if (<= (/ x y) 5e-62) t (* (/ x y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -3000000.0) {
tmp = (x / y) * -t;
} else if ((x / y) <= -1e-88) {
tmp = (x * z) / y;
} else if ((x / y) <= 5e-62) {
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) <= (-3000000.0d0)) then
tmp = (x / y) * -t
else if ((x / y) <= (-1d-88)) then
tmp = (x * z) / y
else if ((x / y) <= 5d-62) 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) <= -3000000.0) {
tmp = (x / y) * -t;
} else if ((x / y) <= -1e-88) {
tmp = (x * z) / y;
} else if ((x / y) <= 5e-62) {
tmp = t;
} else {
tmp = (x / y) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -3000000.0: tmp = (x / y) * -t elif (x / y) <= -1e-88: tmp = (x * z) / y elif (x / y) <= 5e-62: tmp = t else: tmp = (x / y) * z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -3000000.0) tmp = Float64(Float64(x / y) * Float64(-t)); elseif (Float64(x / y) <= -1e-88) tmp = Float64(Float64(x * z) / y); elseif (Float64(x / y) <= 5e-62) 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) <= -3000000.0) tmp = (x / y) * -t; elseif ((x / y) <= -1e-88) tmp = (x * z) / y; elseif ((x / y) <= 5e-62) tmp = t; else tmp = (x / y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -3000000.0], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1e-88], N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-62], t, N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3000000:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-88}:\\
\;\;\;\;\frac{x \cdot z}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-62}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -3e6Initial program 94.4%
Taylor expanded in z around 0 62.6%
mul-1-neg62.6%
*-rgt-identity62.6%
associate-/l*64.0%
distribute-rgt-neg-in64.0%
mul-1-neg64.0%
distribute-lft-in64.0%
mul-1-neg64.0%
unsub-neg64.0%
Simplified64.0%
Taylor expanded in x around inf 62.7%
mul-1-neg62.7%
distribute-frac-neg262.7%
Simplified62.7%
if -3e6 < (/.f64 x y) < -9.99999999999999934e-89Initial program 99.7%
add-cube-cbrt98.0%
associate-*l*98.1%
fma-define98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 61.2%
if -9.99999999999999934e-89 < (/.f64 x y) < 5.0000000000000002e-62Initial program 97.2%
Taylor expanded in x around 0 75.6%
if 5.0000000000000002e-62 < (/.f64 x y) Initial program 99.8%
add-cube-cbrt99.1%
associate-*l*99.2%
fma-define99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 66.3%
associate-*l/74.7%
*-commutative74.7%
Simplified74.7%
Final simplification70.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2000000.0) (not (<= (/ x y) 1e+43))) (/ (* x (- z t)) y) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2000000.0) || !((x / y) <= 1e+43)) {
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) <= (-2000000.0d0)) .or. (.not. ((x / y) <= 1d+43))) 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) <= -2000000.0) || !((x / y) <= 1e+43)) {
tmp = (x * (z - t)) / y;
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2000000.0) or not ((x / y) <= 1e+43): 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) <= -2000000.0) || !(Float64(x / y) <= 1e+43)) tmp = Float64(Float64(x * 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) <= -2000000.0) || ~(((x / y) <= 1e+43))) 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], -2000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e+43]], $MachinePrecision]], N[(N[(x * N[(z - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000000 \lor \neg \left(\frac{x}{y} \leq 10^{+43}\right):\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -2e6 or 1.00000000000000001e43 < (/.f64 x y) Initial program 96.8%
add-cube-cbrt96.0%
associate-*l*96.0%
fma-define96.0%
pow296.0%
Applied egg-rr96.0%
Taylor expanded in x around inf 87.0%
div-sub90.4%
associate-/l*94.5%
Simplified94.5%
if -2e6 < (/.f64 x y) < 1.00000000000000001e43Initial program 97.9%
Taylor expanded in z around inf 94.6%
Final simplification94.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e-88) (not (<= (/ x y) 5e-62))) (* (/ x y) z) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e-88) || !((x / y) <= 5e-62)) {
tmp = (x / y) * 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 (((x / y) <= (-1d-88)) .or. (.not. ((x / y) <= 5d-62))) then
tmp = (x / y) * 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 (((x / y) <= -1e-88) || !((x / y) <= 5e-62)) {
tmp = (x / y) * z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e-88) or not ((x / y) <= 5e-62): tmp = (x / y) * z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e-88) || !(Float64(x / y) <= 5e-62)) tmp = Float64(Float64(x / y) * z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e-88) || ~(((x / y) <= 5e-62))) tmp = (x / y) * z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e-88], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e-62]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{-88} \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999934e-89 or 5.0000000000000002e-62 < (/.f64 x y) Initial program 97.5%
add-cube-cbrt96.6%
associate-*l*96.6%
fma-define96.6%
pow296.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 51.8%
associate-*l/58.2%
*-commutative58.2%
Simplified58.2%
if -9.99999999999999934e-89 < (/.f64 x y) < 5.0000000000000002e-62Initial program 97.2%
Taylor expanded in x around 0 75.6%
Final simplification64.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.5e+43) (not (<= z 6e-89))) (+ t (* (/ x y) z)) (- t (/ t (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e+43) || !(z <= 6e-89)) {
tmp = t + ((x / y) * z);
} else {
tmp = t - (t / (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 ((z <= (-7.5d+43)) .or. (.not. (z <= 6d-89))) then
tmp = t + ((x / y) * z)
else
tmp = t - (t / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e+43) || !(z <= 6e-89)) {
tmp = t + ((x / y) * z);
} else {
tmp = t - (t / (y / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.5e+43) or not (z <= 6e-89): tmp = t + ((x / y) * z) else: tmp = t - (t / (y / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.5e+43) || !(z <= 6e-89)) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(t - Float64(t / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.5e+43) || ~((z <= 6e-89))) tmp = t + ((x / y) * z); else tmp = t - (t / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.5e+43], N[Not[LessEqual[z, 6e-89]], $MachinePrecision]], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+43} \lor \neg \left(z \leq 6 \cdot 10^{-89}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\end{array}
\end{array}
if z < -7.49999999999999967e43 or 5.9999999999999999e-89 < z Initial program 98.1%
Taylor expanded in z around inf 89.3%
if -7.49999999999999967e43 < z < 5.9999999999999999e-89Initial program 96.2%
Taylor expanded in z around 0 81.0%
mul-1-neg81.0%
*-rgt-identity81.0%
associate-/l*83.8%
distribute-rgt-neg-in83.8%
mul-1-neg83.8%
distribute-lft-in83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
distribute-rgt-out--83.8%
*-un-lft-identity83.8%
*-commutative83.8%
clear-num83.7%
un-div-inv83.9%
Applied egg-rr83.9%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.3e+42) (not (<= z 1.95e-90))) (+ t (* (/ x y) z)) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.3e+42) || !(z <= 1.95e-90)) {
tmp = t + ((x / y) * z);
} 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 ((z <= (-3.3d+42)) .or. (.not. (z <= 1.95d-90))) then
tmp = t + ((x / y) * z)
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 ((z <= -3.3e+42) || !(z <= 1.95e-90)) {
tmp = t + ((x / y) * z);
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.3e+42) or not (z <= 1.95e-90): tmp = t + ((x / y) * z) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.3e+42) || !(z <= 1.95e-90)) tmp = Float64(t + Float64(Float64(x / y) * z)); 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 ((z <= -3.3e+42) || ~((z <= 1.95e-90))) tmp = t + ((x / y) * z); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.3e+42], N[Not[LessEqual[z, 1.95e-90]], $MachinePrecision]], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+42} \lor \neg \left(z \leq 1.95 \cdot 10^{-90}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -3.2999999999999999e42 or 1.95000000000000002e-90 < z Initial program 98.1%
Taylor expanded in z around inf 89.3%
if -3.2999999999999999e42 < z < 1.95000000000000002e-90Initial program 96.2%
Taylor expanded in z around 0 81.0%
mul-1-neg81.0%
*-rgt-identity81.0%
associate-/l*83.8%
distribute-rgt-neg-in83.8%
mul-1-neg83.8%
distribute-lft-in83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.82e+43) (not (<= z 0.0035))) (+ t (* x (/ z y))) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.82e+43) || !(z <= 0.0035)) {
tmp = t + (x * (z / 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 ((z <= (-1.82d+43)) .or. (.not. (z <= 0.0035d0))) then
tmp = t + (x * (z / 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 ((z <= -1.82e+43) || !(z <= 0.0035)) {
tmp = t + (x * (z / y));
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.82e+43) or not (z <= 0.0035): tmp = t + (x * (z / y)) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.82e+43) || !(z <= 0.0035)) tmp = Float64(t + Float64(x * Float64(z / 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 ((z <= -1.82e+43) || ~((z <= 0.0035))) tmp = t + (x * (z / y)); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.82e+43], N[Not[LessEqual[z, 0.0035]], $MachinePrecision]], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.82 \cdot 10^{+43} \lor \neg \left(z \leq 0.0035\right):\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -1.8199999999999999e43 or 0.00350000000000000007 < z Initial program 97.8%
Taylor expanded in z around inf 85.1%
associate-/l*89.4%
Simplified89.4%
if -1.8199999999999999e43 < z < 0.00350000000000000007Initial program 96.9%
Taylor expanded in z around 0 80.4%
mul-1-neg80.4%
*-rgt-identity80.4%
associate-/l*82.7%
distribute-rgt-neg-in82.7%
mul-1-neg82.7%
distribute-lft-in82.7%
mul-1-neg82.7%
unsub-neg82.7%
Simplified82.7%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.5e+93) (/ x (/ y z)) (if (<= z 1.65e+80) (* t (- 1.0 (/ x y))) (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+93) {
tmp = x / (y / z);
} else if (z <= 1.65e+80) {
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 (z <= (-1.5d+93)) then
tmp = x / (y / z)
else if (z <= 1.65d+80) 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 (z <= -1.5e+93) {
tmp = x / (y / z);
} else if (z <= 1.65e+80) {
tmp = t * (1.0 - (x / y));
} else {
tmp = (x / y) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+93: tmp = x / (y / z) elif z <= 1.65e+80: tmp = t * (1.0 - (x / y)) else: tmp = (x / y) * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+93) tmp = Float64(x / Float64(y / z)); elseif (z <= 1.65e+80) 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 (z <= -1.5e+93) tmp = x / (y / z); elseif (z <= 1.65e+80) tmp = t * (1.0 - (x / y)); else tmp = (x / y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e+93], N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+80], 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}\;z \leq -1.5 \cdot 10^{+93}:\\
\;\;\;\;\frac{x}{\frac{y}{z}}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+80}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\end{array}
\end{array}
if z < -1.49999999999999989e93Initial program 96.4%
add-cube-cbrt95.7%
associate-*l*95.7%
fma-define95.7%
pow295.7%
Applied egg-rr95.7%
Taylor expanded in z around inf 66.9%
associate-*r/75.2%
Simplified75.2%
clear-num75.2%
un-div-inv75.3%
Applied egg-rr75.3%
if -1.49999999999999989e93 < z < 1.64999999999999995e80Initial program 97.5%
Taylor expanded in z around 0 76.2%
mul-1-neg76.2%
*-rgt-identity76.2%
associate-/l*78.1%
distribute-rgt-neg-in78.1%
mul-1-neg78.1%
distribute-lft-in78.1%
mul-1-neg78.1%
unsub-neg78.1%
Simplified78.1%
if 1.64999999999999995e80 < z Initial program 98.1%
add-cube-cbrt97.2%
associate-*l*97.2%
fma-define97.2%
pow297.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 69.4%
associate-*l/77.7%
*-commutative77.7%
Simplified77.7%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (<= t -6.4e+37) t (if (<= t 3.4e-24) (* x (/ z y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.4e+37) {
tmp = t;
} else if (t <= 3.4e-24) {
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 (t <= (-6.4d+37)) then
tmp = t
else if (t <= 3.4d-24) 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 (t <= -6.4e+37) {
tmp = t;
} else if (t <= 3.4e-24) {
tmp = x * (z / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -6.4e+37: tmp = t elif t <= 3.4e-24: tmp = x * (z / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -6.4e+37) tmp = t; elseif (t <= 3.4e-24) 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 (t <= -6.4e+37) tmp = t; elseif (t <= 3.4e-24) tmp = x * (z / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -6.4e+37], t, If[LessEqual[t, 3.4e-24], N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+37}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -6.40000000000000027e37 or 3.39999999999999992e-24 < t Initial program 99.9%
Taylor expanded in x around 0 47.5%
if -6.40000000000000027e37 < t < 3.39999999999999992e-24Initial program 95.2%
add-cube-cbrt94.3%
associate-*l*94.4%
fma-define94.4%
pow294.4%
Applied egg-rr94.4%
Taylor expanded in z around inf 60.8%
associate-*r/62.9%
Simplified62.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 97.4%
Taylor expanded in x around 0 33.3%
(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 2024139
(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))