
(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 14 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 96.8%
fma-define96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.0) (not (<= (/ x y) 2e+18))) (* (/ x y) (- t)) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.0) || !((x / y) <= 2e+18)) {
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) <= (-1.0d0)) .or. (.not. ((x / y) <= 2d+18))) 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) <= -1.0) || !((x / y) <= 2e+18)) {
tmp = (x / y) * -t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.0) or not ((x / y) <= 2e+18): tmp = (x / y) * -t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.0) || !(Float64(x / y) <= 2e+18)) 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) <= -1.0) || ~(((x / y) <= 2e+18))) tmp = (x / y) * -t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+18]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -1 or 2e18 < (/.f64 x y) Initial program 97.3%
Taylor expanded in z around 0 44.9%
*-rgt-identity44.9%
mul-1-neg44.9%
associate-/l*46.6%
distribute-rgt-neg-in46.6%
mul-1-neg46.6%
distribute-lft-in46.6%
mul-1-neg46.6%
unsub-neg46.6%
Simplified46.6%
Taylor expanded in x around inf 45.9%
mul-1-neg45.9%
distribute-frac-neg245.9%
Simplified45.9%
if -1 < (/.f64 x y) < 2e18Initial program 96.5%
Taylor expanded in x around 0 70.4%
Final simplification60.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.0) (/ t (/ y (- x))) (if (<= (/ x y) 2e+18) t (* (/ x y) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.0) {
tmp = t / (y / -x);
} else if ((x / y) <= 2e+18) {
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) <= (-1.0d0)) then
tmp = t / (y / -x)
else if ((x / y) <= 2d+18) 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) <= -1.0) {
tmp = t / (y / -x);
} else if ((x / y) <= 2e+18) {
tmp = t;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.0: tmp = t / (y / -x) elif (x / y) <= 2e+18: tmp = t else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.0) tmp = Float64(t / Float64(y / Float64(-x))); elseif (Float64(x / y) <= 2e+18) 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) <= -1.0) tmp = t / (y / -x); elseif ((x / y) <= 2e+18) tmp = t; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.0], N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+18], t, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+18}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1Initial program 96.7%
Taylor expanded in z around 0 43.5%
*-rgt-identity43.5%
mul-1-neg43.5%
associate-/l*43.5%
distribute-rgt-neg-in43.5%
mul-1-neg43.5%
distribute-lft-in43.5%
mul-1-neg43.5%
unsub-neg43.5%
Simplified43.5%
Taylor expanded in x around inf 42.2%
mul-1-neg42.2%
distribute-frac-neg242.2%
Simplified42.2%
Taylor expanded in t around 0 42.2%
associate-*l/37.3%
associate-/r/42.2%
associate-*r/42.2%
neg-mul-142.2%
Simplified42.2%
if -1 < (/.f64 x y) < 2e18Initial program 96.5%
Taylor expanded in x around 0 70.4%
if 2e18 < (/.f64 x y) Initial program 98.0%
Taylor expanded in z around 0 46.5%
*-rgt-identity46.5%
mul-1-neg46.5%
associate-/l*50.5%
distribute-rgt-neg-in50.5%
mul-1-neg50.5%
distribute-lft-in50.5%
mul-1-neg50.5%
unsub-neg50.5%
Simplified50.5%
Taylor expanded in x around inf 50.5%
mul-1-neg50.5%
distribute-frac-neg250.5%
Simplified50.5%
Final simplification60.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.4e+270) (not (<= (/ x y) 0.38))) (* (/ x y) t) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.4e+270) || !((x / y) <= 0.38)) {
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) <= (-2.4d+270)) .or. (.not. ((x / y) <= 0.38d0))) 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) <= -2.4e+270) || !((x / y) <= 0.38)) {
tmp = (x / y) * t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.4e+270) or not ((x / y) <= 0.38): tmp = (x / y) * t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.4e+270) || !(Float64(x / y) <= 0.38)) tmp = Float64(Float64(x / y) * t); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.4e+270) || ~(((x / y) <= 0.38))) tmp = (x / y) * t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.4e+270], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.38]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.4 \cdot 10^{+270} \lor \neg \left(\frac{x}{y} \leq 0.38\right):\\
\;\;\;\;\frac{x}{y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -2.4000000000000001e270 or 0.38 < (/.f64 x y) Initial program 96.0%
Taylor expanded in z around 0 46.7%
*-rgt-identity46.7%
mul-1-neg46.7%
associate-/l*49.3%
distribute-rgt-neg-in49.3%
mul-1-neg49.3%
distribute-lft-in49.4%
mul-1-neg49.4%
unsub-neg49.4%
Simplified49.4%
Taylor expanded in x around inf 45.4%
associate-*r/45.4%
*-commutative45.4%
mul-1-neg45.4%
distribute-neg-frac45.4%
distribute-frac-neg245.4%
associate-/l*45.4%
Simplified45.4%
add045.4%
add-sqr-sqrt28.3%
sqrt-unprod41.4%
sqr-neg41.4%
sqrt-unprod10.5%
add-sqr-sqrt16.4%
Applied egg-rr16.4%
add016.4%
associate-*r/17.9%
*-commutative17.9%
associate-*r/17.9%
Simplified17.9%
if -2.4000000000000001e270 < (/.f64 x y) < 0.38Initial program 97.2%
Taylor expanded in x around 0 57.4%
Final simplification46.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e+285) (* (/ x y) t) (if (<= (/ x y) 5e-7) t (/ t (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+285) {
tmp = (x / y) * t;
} else if ((x / y) <= 5e-7) {
tmp = t;
} else {
tmp = 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 ((x / y) <= (-2d+285)) then
tmp = (x / y) * t
else if ((x / y) <= 5d-7) then
tmp = t
else
tmp = t / (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+285) {
tmp = (x / y) * t;
} else if ((x / y) <= 5e-7) {
tmp = t;
} else {
tmp = t / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+285: tmp = (x / y) * t elif (x / y) <= 5e-7: tmp = t else: tmp = t / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+285) tmp = Float64(Float64(x / y) * t); elseif (Float64(x / y) <= 5e-7) tmp = t; else tmp = Float64(t / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+285) tmp = (x / y) * t; elseif ((x / y) <= 5e-7) tmp = t; else tmp = t / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+285], N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-7], t, N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+285}:\\
\;\;\;\;\frac{x}{y} \cdot t\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e285Initial program 90.7%
Taylor expanded in z around 0 51.1%
*-rgt-identity51.1%
mul-1-neg51.1%
associate-/l*51.1%
distribute-rgt-neg-in51.1%
mul-1-neg51.1%
distribute-lft-in51.1%
mul-1-neg51.1%
unsub-neg51.1%
Simplified51.1%
Taylor expanded in x around inf 51.1%
associate-*r/51.1%
*-commutative51.1%
mul-1-neg51.1%
distribute-neg-frac51.1%
distribute-frac-neg251.1%
associate-/l*51.1%
Simplified51.1%
add051.1%
add-sqr-sqrt20.7%
sqrt-unprod50.5%
sqr-neg50.5%
sqrt-unprod15.6%
add-sqr-sqrt20.6%
Applied egg-rr20.6%
add020.6%
associate-*r/20.6%
*-commutative20.6%
associate-*r/25.3%
Simplified25.3%
if -2e285 < (/.f64 x y) < 4.99999999999999977e-7Initial program 97.2%
Taylor expanded in x around 0 57.4%
if 4.99999999999999977e-7 < (/.f64 x y) Initial program 98.0%
Taylor expanded in z around 0 45.0%
*-rgt-identity45.0%
mul-1-neg45.0%
associate-/l*48.6%
distribute-rgt-neg-in48.6%
mul-1-neg48.6%
distribute-lft-in48.7%
mul-1-neg48.7%
unsub-neg48.7%
Simplified48.7%
Taylor expanded in x around inf 46.8%
mul-1-neg46.8%
distribute-frac-neg246.8%
Simplified46.8%
associate-*r/43.2%
add-sqr-sqrt29.4%
sqrt-unprod37.9%
sqr-neg37.9%
sqrt-unprod8.8%
add-sqr-sqrt16.8%
associate-*l/14.9%
associate-/r/15.1%
Applied egg-rr15.1%
Final simplification46.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e+285) (* (/ x y) t) (if (<= (/ x y) 5e-7) t (/ (* x t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+285) {
tmp = (x / y) * t;
} else if ((x / y) <= 5e-7) {
tmp = t;
} else {
tmp = (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 ((x / y) <= (-2d+285)) then
tmp = (x / y) * t
else if ((x / y) <= 5d-7) then
tmp = t
else
tmp = (x * t) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+285) {
tmp = (x / y) * t;
} else if ((x / y) <= 5e-7) {
tmp = t;
} else {
tmp = (x * t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+285: tmp = (x / y) * t elif (x / y) <= 5e-7: tmp = t else: tmp = (x * t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+285) tmp = Float64(Float64(x / y) * t); elseif (Float64(x / y) <= 5e-7) tmp = t; else tmp = Float64(Float64(x * t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+285) tmp = (x / y) * t; elseif ((x / y) <= 5e-7) tmp = t; else tmp = (x * t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+285], N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-7], t, N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+285}:\\
\;\;\;\;\frac{x}{y} \cdot t\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e285Initial program 90.7%
Taylor expanded in z around 0 51.1%
*-rgt-identity51.1%
mul-1-neg51.1%
associate-/l*51.1%
distribute-rgt-neg-in51.1%
mul-1-neg51.1%
distribute-lft-in51.1%
mul-1-neg51.1%
unsub-neg51.1%
Simplified51.1%
Taylor expanded in x around inf 51.1%
associate-*r/51.1%
*-commutative51.1%
mul-1-neg51.1%
distribute-neg-frac51.1%
distribute-frac-neg251.1%
associate-/l*51.1%
Simplified51.1%
add051.1%
add-sqr-sqrt20.7%
sqrt-unprod50.5%
sqr-neg50.5%
sqrt-unprod15.6%
add-sqr-sqrt20.6%
Applied egg-rr20.6%
add020.6%
associate-*r/20.6%
*-commutative20.6%
associate-*r/25.3%
Simplified25.3%
if -2e285 < (/.f64 x y) < 4.99999999999999977e-7Initial program 97.2%
Taylor expanded in x around 0 57.4%
if 4.99999999999999977e-7 < (/.f64 x y) Initial program 98.0%
Taylor expanded in z around 0 45.0%
*-rgt-identity45.0%
mul-1-neg45.0%
associate-/l*48.6%
distribute-rgt-neg-in48.6%
mul-1-neg48.6%
distribute-lft-in48.7%
mul-1-neg48.7%
unsub-neg48.7%
Simplified48.7%
Taylor expanded in x around inf 43.2%
associate-*r/43.2%
*-commutative43.2%
mul-1-neg43.2%
distribute-neg-frac43.2%
distribute-frac-neg243.2%
associate-/l*43.2%
Simplified43.2%
associate-*r/43.2%
add-sqr-sqrt29.4%
sqrt-unprod37.9%
sqr-neg37.9%
sqrt-unprod8.8%
add-sqr-sqrt16.8%
Applied egg-rr16.8%
Final simplification46.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2e-140) (not (<= z 5.5e-99))) (+ t (* x (/ z y))) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e-140) || !(z <= 5.5e-99)) {
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 <= (-2d-140)) .or. (.not. (z <= 5.5d-99))) 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 <= -2e-140) || !(z <= 5.5e-99)) {
tmp = t + (x * (z / y));
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2e-140) or not (z <= 5.5e-99): 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 <= -2e-140) || !(z <= 5.5e-99)) 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 <= -2e-140) || ~((z <= 5.5e-99))) 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, -2e-140], N[Not[LessEqual[z, 5.5e-99]], $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 -2 \cdot 10^{-140} \lor \neg \left(z \leq 5.5 \cdot 10^{-99}\right):\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -2e-140 or 5.49999999999999991e-99 < z Initial program 96.8%
Taylor expanded in z around inf 87.3%
associate-/l*86.5%
Simplified86.5%
if -2e-140 < z < 5.49999999999999991e-99Initial program 97.1%
Taylor expanded in z around 0 90.1%
*-rgt-identity90.1%
mul-1-neg90.1%
associate-/l*91.5%
distribute-rgt-neg-in91.5%
mul-1-neg91.5%
distribute-lft-in91.5%
mul-1-neg91.5%
unsub-neg91.5%
Simplified91.5%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.2e-143) (not (<= z 5e-101))) (+ t (* (/ x y) z)) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e-143) || !(z <= 5e-101)) {
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 <= (-4.2d-143)) .or. (.not. (z <= 5d-101))) 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 <= -4.2e-143) || !(z <= 5e-101)) {
tmp = t + ((x / y) * z);
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.2e-143) or not (z <= 5e-101): 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 <= -4.2e-143) || !(z <= 5e-101)) 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 <= -4.2e-143) || ~((z <= 5e-101))) 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, -4.2e-143], N[Not[LessEqual[z, 5e-101]], $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 -4.2 \cdot 10^{-143} \lor \neg \left(z \leq 5 \cdot 10^{-101}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -4.2000000000000002e-143 or 5.0000000000000001e-101 < z Initial program 96.8%
Taylor expanded in z around inf 87.3%
associate-/l*86.5%
Simplified86.5%
*-commutative86.5%
associate-*l/87.3%
Applied egg-rr87.3%
associate-/l*87.0%
*-commutative87.0%
Applied egg-rr87.0%
if -4.2000000000000002e-143 < z < 5.0000000000000001e-101Initial program 97.1%
Taylor expanded in z around 0 90.1%
*-rgt-identity90.1%
mul-1-neg90.1%
associate-/l*91.5%
distribute-rgt-neg-in91.5%
mul-1-neg91.5%
distribute-lft-in91.5%
mul-1-neg91.5%
unsub-neg91.5%
Simplified91.5%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (<= z -8e-139) (+ t (/ x (/ y z))) (if (<= z 1.42e-102) (* t (- 1.0 (/ x y))) (+ t (* (/ x y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e-139) {
tmp = t + (x / (y / z));
} else if (z <= 1.42e-102) {
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 (z <= (-8d-139)) then
tmp = t + (x / (y / z))
else if (z <= 1.42d-102) 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 (z <= -8e-139) {
tmp = t + (x / (y / z));
} else if (z <= 1.42e-102) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8e-139: tmp = t + (x / (y / z)) elif z <= 1.42e-102: tmp = t * (1.0 - (x / y)) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8e-139) tmp = Float64(t + Float64(x / Float64(y / z))); elseif (z <= 1.42e-102) 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 (z <= -8e-139) tmp = t + (x / (y / z)); elseif (z <= 1.42e-102) tmp = t * (1.0 - (x / y)); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8e-139], N[(t + N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e-102], 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}\;z \leq -8 \cdot 10^{-139}:\\
\;\;\;\;t + \frac{x}{\frac{y}{z}}\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-102}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if z < -8.00000000000000024e-139Initial program 95.9%
associate-*l/95.8%
associate-*r/92.7%
clear-num92.7%
un-div-inv93.1%
Applied egg-rr93.1%
Taylor expanded in z around inf 83.1%
if -8.00000000000000024e-139 < z < 1.42000000000000009e-102Initial program 97.1%
Taylor expanded in z around 0 90.1%
*-rgt-identity90.1%
mul-1-neg90.1%
associate-/l*91.5%
distribute-rgt-neg-in91.5%
mul-1-neg91.5%
distribute-lft-in91.5%
mul-1-neg91.5%
unsub-neg91.5%
Simplified91.5%
if 1.42000000000000009e-102 < z Initial program 97.7%
Taylor expanded in z around inf 90.5%
associate-/l*90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/90.5%
Applied egg-rr90.5%
associate-/l*91.3%
*-commutative91.3%
Applied egg-rr91.3%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (if (<= z -3.4e-138) (+ t (/ (* x z) y)) (if (<= z 6.2e-95) (* t (- 1.0 (/ x y))) (+ t (* (/ x y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.4e-138) {
tmp = t + ((x * z) / y);
} else if (z <= 6.2e-95) {
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 (z <= (-3.4d-138)) then
tmp = t + ((x * z) / y)
else if (z <= 6.2d-95) 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 (z <= -3.4e-138) {
tmp = t + ((x * z) / y);
} else if (z <= 6.2e-95) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.4e-138: tmp = t + ((x * z) / y) elif z <= 6.2e-95: tmp = t * (1.0 - (x / y)) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.4e-138) tmp = Float64(t + Float64(Float64(x * z) / y)); elseif (z <= 6.2e-95) 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 (z <= -3.4e-138) tmp = t + ((x * z) / y); elseif (z <= 6.2e-95) tmp = t * (1.0 - (x / y)); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.4e-138], N[(t + N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-95], 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}\;z \leq -3.4 \cdot 10^{-138}:\\
\;\;\;\;t + \frac{x \cdot z}{y}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if z < -3.4000000000000001e-138Initial program 95.9%
Taylor expanded in z around inf 84.0%
if -3.4000000000000001e-138 < z < 6.19999999999999983e-95Initial program 97.1%
Taylor expanded in z around 0 90.1%
*-rgt-identity90.1%
mul-1-neg90.1%
associate-/l*91.5%
distribute-rgt-neg-in91.5%
mul-1-neg91.5%
distribute-lft-in91.5%
mul-1-neg91.5%
unsub-neg91.5%
Simplified91.5%
if 6.19999999999999983e-95 < z Initial program 97.7%
Taylor expanded in z around inf 90.5%
associate-/l*90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/90.5%
Applied egg-rr90.5%
associate-/l*91.3%
*-commutative91.3%
Applied egg-rr91.3%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.65e-138) (+ t (/ (* x z) y)) (if (<= z 2.4e-93) (- t (/ t (/ y x))) (+ t (* (/ x y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e-138) {
tmp = t + ((x * z) / y);
} else if (z <= 2.4e-93) {
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 (z <= (-1.65d-138)) then
tmp = t + ((x * z) / y)
else if (z <= 2.4d-93) 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 (z <= -1.65e-138) {
tmp = t + ((x * z) / y);
} else if (z <= 2.4e-93) {
tmp = t - (t / (y / x));
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.65e-138: tmp = t + ((x * z) / y) elif z <= 2.4e-93: tmp = t - (t / (y / x)) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e-138) tmp = Float64(t + Float64(Float64(x * z) / y)); elseif (z <= 2.4e-93) 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 (z <= -1.65e-138) tmp = t + ((x * z) / y); elseif (z <= 2.4e-93) tmp = t - (t / (y / x)); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e-138], N[(t + N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-93], 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}\;z \leq -1.65 \cdot 10^{-138}:\\
\;\;\;\;t + \frac{x \cdot z}{y}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-93}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if z < -1.64999999999999991e-138Initial program 95.9%
Taylor expanded in z around inf 84.0%
if -1.64999999999999991e-138 < z < 2.4000000000000001e-93Initial program 97.1%
Taylor expanded in z around 0 90.1%
*-rgt-identity90.1%
mul-1-neg90.1%
associate-/l*91.5%
distribute-rgt-neg-in91.5%
mul-1-neg91.5%
distribute-lft-in91.5%
mul-1-neg91.5%
unsub-neg91.5%
Simplified91.5%
distribute-rgt-out--91.5%
*-un-lft-identity91.5%
*-commutative91.5%
clear-num91.5%
un-div-inv91.6%
Applied egg-rr91.6%
if 2.4000000000000001e-93 < z Initial program 97.7%
Taylor expanded in z around inf 90.5%
associate-/l*90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/90.5%
Applied egg-rr90.5%
associate-/l*91.3%
*-commutative91.3%
Applied egg-rr91.3%
Final simplification88.7%
(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 96.8%
Final simplification96.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 96.8%
Taylor expanded in z around 0 59.2%
*-rgt-identity59.2%
mul-1-neg59.2%
associate-/l*61.5%
distribute-rgt-neg-in61.5%
mul-1-neg61.5%
distribute-lft-in61.5%
mul-1-neg61.5%
unsub-neg61.5%
Simplified61.5%
Final simplification61.5%
(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 96.8%
Taylor expanded in x around 0 41.7%
Final simplification41.7%
(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 2024046
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(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))