
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * 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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot 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 y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * 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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (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 - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 96.9%
associate-*l/83.9%
associate-/l*84.6%
Simplified84.6%
associate-*r/83.9%
associate-*l/96.9%
*-commutative96.9%
clear-num96.7%
un-div-inv97.0%
Applied egg-rr97.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1950000000000.0) t (if (<= y 7.2e-24) (/ t (/ z x)) (if (<= y 3.4e+96) (/ (* t (- x)) y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1950000000000.0) {
tmp = t;
} else if (y <= 7.2e-24) {
tmp = t / (z / x);
} else if (y <= 3.4e+96) {
tmp = (t * -x) / 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 (y <= (-1950000000000.0d0)) then
tmp = t
else if (y <= 7.2d-24) then
tmp = t / (z / x)
else if (y <= 3.4d+96) then
tmp = (t * -x) / 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 (y <= -1950000000000.0) {
tmp = t;
} else if (y <= 7.2e-24) {
tmp = t / (z / x);
} else if (y <= 3.4e+96) {
tmp = (t * -x) / y;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1950000000000.0: tmp = t elif y <= 7.2e-24: tmp = t / (z / x) elif y <= 3.4e+96: tmp = (t * -x) / y else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1950000000000.0) tmp = t; elseif (y <= 7.2e-24) tmp = Float64(t / Float64(z / x)); elseif (y <= 3.4e+96) tmp = Float64(Float64(t * Float64(-x)) / y); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1950000000000.0) tmp = t; elseif (y <= 7.2e-24) tmp = t / (z / x); elseif (y <= 3.4e+96) tmp = (t * -x) / y; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1950000000000.0], t, If[LessEqual[y, 7.2e-24], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+96], N[(N[(t * (-x)), $MachinePrecision] / y), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1950000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-24}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+96}:\\
\;\;\;\;\frac{t \cdot \left(-x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.95e12 or 3.4000000000000001e96 < y Initial program 99.9%
associate-*l/68.4%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in y around inf 76.1%
if -1.95e12 < y < 7.2000000000000002e-24Initial program 93.9%
associate-*l/93.1%
associate-/l*90.9%
Simplified90.9%
associate-*r/93.1%
associate-*l/93.9%
*-commutative93.9%
clear-num93.7%
un-div-inv94.2%
Applied egg-rr94.2%
Taylor expanded in y around 0 69.3%
if 7.2000000000000002e-24 < y < 3.4000000000000001e96Initial program 99.7%
associate-*l/95.7%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in x around inf 58.4%
Taylor expanded in z around 0 51.6%
associate-*r/51.6%
mul-1-neg51.6%
distribute-rgt-neg-out51.6%
Simplified51.6%
(FPCore (x y z t) :precision binary64 (if (<= y -2300000000000.0) t (if (<= y 1.5e-20) (/ t (/ z x)) (if (<= y 2.2e+96) (* t (/ x (- y))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2300000000000.0) {
tmp = t;
} else if (y <= 1.5e-20) {
tmp = t / (z / x);
} else if (y <= 2.2e+96) {
tmp = t * (x / -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 (y <= (-2300000000000.0d0)) then
tmp = t
else if (y <= 1.5d-20) then
tmp = t / (z / x)
else if (y <= 2.2d+96) then
tmp = t * (x / -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 (y <= -2300000000000.0) {
tmp = t;
} else if (y <= 1.5e-20) {
tmp = t / (z / x);
} else if (y <= 2.2e+96) {
tmp = t * (x / -y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2300000000000.0: tmp = t elif y <= 1.5e-20: tmp = t / (z / x) elif y <= 2.2e+96: tmp = t * (x / -y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2300000000000.0) tmp = t; elseif (y <= 1.5e-20) tmp = Float64(t / Float64(z / x)); elseif (y <= 2.2e+96) tmp = Float64(t * Float64(x / Float64(-y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2300000000000.0) tmp = t; elseif (y <= 1.5e-20) tmp = t / (z / x); elseif (y <= 2.2e+96) tmp = t * (x / -y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2300000000000.0], t, If[LessEqual[y, 1.5e-20], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+96], N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2300000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+96}:\\
\;\;\;\;t \cdot \frac{x}{-y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.3e12 or 2.1999999999999999e96 < y Initial program 99.9%
associate-*l/68.4%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in y around inf 76.1%
if -2.3e12 < y < 1.50000000000000014e-20Initial program 93.9%
associate-*l/93.1%
associate-/l*90.9%
Simplified90.9%
associate-*r/93.1%
associate-*l/93.9%
*-commutative93.9%
clear-num93.7%
un-div-inv94.2%
Applied egg-rr94.2%
Taylor expanded in y around 0 69.3%
if 1.50000000000000014e-20 < y < 2.1999999999999999e96Initial program 99.7%
associate-*l/95.7%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in x around inf 53.3%
Taylor expanded in z around 0 51.6%
mul-1-neg51.6%
associate-/l*51.6%
distribute-lft-neg-in51.6%
Simplified51.6%
Final simplification69.9%
(FPCore (x y z t) :precision binary64 (if (<= y -3900000000000.0) t (if (<= y 1.7e-23) (/ t (/ z x)) (if (<= y 1.85e+98) (* x (/ t (- y))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3900000000000.0) {
tmp = t;
} else if (y <= 1.7e-23) {
tmp = t / (z / x);
} else if (y <= 1.85e+98) {
tmp = x * (t / -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 (y <= (-3900000000000.0d0)) then
tmp = t
else if (y <= 1.7d-23) then
tmp = t / (z / x)
else if (y <= 1.85d+98) then
tmp = x * (t / -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 (y <= -3900000000000.0) {
tmp = t;
} else if (y <= 1.7e-23) {
tmp = t / (z / x);
} else if (y <= 1.85e+98) {
tmp = x * (t / -y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3900000000000.0: tmp = t elif y <= 1.7e-23: tmp = t / (z / x) elif y <= 1.85e+98: tmp = x * (t / -y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3900000000000.0) tmp = t; elseif (y <= 1.7e-23) tmp = Float64(t / Float64(z / x)); elseif (y <= 1.85e+98) tmp = Float64(x * Float64(t / Float64(-y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3900000000000.0) tmp = t; elseif (y <= 1.7e-23) tmp = t / (z / x); elseif (y <= 1.85e+98) tmp = x * (t / -y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3900000000000.0], t, If[LessEqual[y, 1.7e-23], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+98], N[(x * N[(t / (-y)), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3900000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-23}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \frac{t}{-y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.9e12 or 1.8499999999999999e98 < y Initial program 99.9%
associate-*l/68.4%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in y around inf 76.1%
if -3.9e12 < y < 1.7e-23Initial program 93.9%
associate-*l/93.1%
associate-/l*90.9%
Simplified90.9%
associate-*r/93.1%
associate-*l/93.9%
*-commutative93.9%
clear-num93.7%
un-div-inv94.2%
Applied egg-rr94.2%
Taylor expanded in y around 0 69.3%
if 1.7e-23 < y < 1.8499999999999999e98Initial program 99.7%
associate-*l/95.7%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in x around inf 53.3%
Taylor expanded in z around 0 45.3%
associate-*r/45.3%
neg-mul-145.3%
Simplified45.3%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.02e+183) (not (<= y 1.06e+130))) (* t (/ (- y x) y)) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.02e+183) || !(y <= 1.06e+130)) {
tmp = t * ((y - x) / y);
} else {
tmp = (x - y) * (t / (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 ((y <= (-1.02d+183)) .or. (.not. (y <= 1.06d+130))) then
tmp = t * ((y - x) / y)
else
tmp = (x - y) * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.02e+183) || !(y <= 1.06e+130)) {
tmp = t * ((y - x) / y);
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.02e+183) or not (y <= 1.06e+130): tmp = t * ((y - x) / y) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.02e+183) || !(y <= 1.06e+130)) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.02e+183) || ~((y <= 1.06e+130))) tmp = t * ((y - x) / y); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.02e+183], N[Not[LessEqual[y, 1.06e+130]], $MachinePrecision]], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+183} \lor \neg \left(y \leq 1.06 \cdot 10^{+130}\right):\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.02000000000000002e183 or 1.06e130 < y Initial program 99.9%
Taylor expanded in z around 0 94.8%
associate-*r/94.8%
neg-mul-194.8%
neg-sub094.8%
sub-neg94.8%
+-commutative94.8%
associate--r+94.8%
neg-sub094.8%
remove-double-neg94.8%
Simplified94.8%
if -1.02000000000000002e183 < y < 1.06e130Initial program 95.8%
associate-*l/93.1%
associate-/l*89.2%
Simplified89.2%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.6e+22) (not (<= y 3.4e-40))) (* t (/ (- y x) y)) (* t (/ x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.6e+22) || !(y <= 3.4e-40)) {
tmp = t * ((y - x) / 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 ((y <= (-9.6d+22)) .or. (.not. (y <= 3.4d-40))) then
tmp = t * ((y - x) / 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 ((y <= -9.6e+22) || !(y <= 3.4e-40)) {
tmp = t * ((y - x) / y);
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.6e+22) or not (y <= 3.4e-40): tmp = t * ((y - x) / y) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.6e+22) || !(y <= 3.4e-40)) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.6e+22) || ~((y <= 3.4e-40))) tmp = t * ((y - x) / y); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.6e+22], N[Not[LessEqual[y, 3.4e-40]], $MachinePrecision]], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+22} \lor \neg \left(y \leq 3.4 \cdot 10^{-40}\right):\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -9.6e22 or 3.39999999999999984e-40 < y Initial program 99.8%
Taylor expanded in z around 0 83.4%
associate-*r/83.4%
neg-mul-183.4%
neg-sub083.4%
sub-neg83.4%
+-commutative83.4%
associate--r+83.4%
neg-sub083.4%
remove-double-neg83.4%
Simplified83.4%
if -9.6e22 < y < 3.39999999999999984e-40Initial program 93.8%
Taylor expanded in x around inf 79.4%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.5e+23) (not (<= y 6.5e+89))) (* t (/ y (- y z))) (* t (/ x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.5e+23) || !(y <= 6.5e+89)) {
tmp = t * (y / (y - z));
} 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 ((y <= (-4.5d+23)) .or. (.not. (y <= 6.5d+89))) then
tmp = t * (y / (y - z))
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 ((y <= -4.5e+23) || !(y <= 6.5e+89)) {
tmp = t * (y / (y - z));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.5e+23) or not (y <= 6.5e+89): tmp = t * (y / (y - z)) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.5e+23) || !(y <= 6.5e+89)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.5e+23) || ~((y <= 6.5e+89))) tmp = t * (y / (y - z)); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.5e+23], N[Not[LessEqual[y, 6.5e+89]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+23} \lor \neg \left(y \leq 6.5 \cdot 10^{+89}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -4.49999999999999979e23 or 6.4999999999999996e89 < y Initial program 99.9%
Taylor expanded in x around 0 85.9%
neg-mul-185.9%
distribute-neg-frac285.9%
neg-sub085.9%
sub-neg85.9%
+-commutative85.9%
associate--r+85.9%
neg-sub085.9%
remove-double-neg85.9%
Simplified85.9%
if -4.49999999999999979e23 < y < 6.4999999999999996e89Initial program 95.0%
Taylor expanded in x around inf 75.6%
Final simplification79.6%
(FPCore (x y z t) :precision binary64 (if (<= y -7.6e+28) t (if (<= y 2.6e+100) (* t (/ x (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.6e+28) {
tmp = t;
} else if (y <= 2.6e+100) {
tmp = t * (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 (y <= (-7.6d+28)) then
tmp = t
else if (y <= 2.6d+100) then
tmp = t * (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 (y <= -7.6e+28) {
tmp = t;
} else if (y <= 2.6e+100) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.6e+28: tmp = t elif y <= 2.6e+100: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.6e+28) tmp = t; elseif (y <= 2.6e+100) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.6e+28) tmp = t; elseif (y <= 2.6e+100) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+28], t, If[LessEqual[y, 2.6e+100], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+28}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+100}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.5999999999999998e28 or 2.6000000000000002e100 < y Initial program 99.9%
associate-*l/67.8%
associate-/l*74.4%
Simplified74.4%
Taylor expanded in y around inf 77.7%
if -7.5999999999999998e28 < y < 2.6000000000000002e100Initial program 95.0%
Taylor expanded in x around inf 75.8%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.05e+26) t (if (<= y 7.5e+96) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+26) {
tmp = t;
} else if (y <= 7.5e+96) {
tmp = x * (t / (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 (y <= (-1.05d+26)) then
tmp = t
else if (y <= 7.5d+96) then
tmp = x * (t / (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 (y <= -1.05e+26) {
tmp = t;
} else if (y <= 7.5e+96) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e+26: tmp = t elif y <= 7.5e+96: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e+26) tmp = t; elseif (y <= 7.5e+96) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e+26) tmp = t; elseif (y <= 7.5e+96) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e+26], t, If[LessEqual[y, 7.5e+96], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+26}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.05e26 or 7.4999999999999996e96 < y Initial program 99.9%
associate-*l/67.8%
associate-/l*74.4%
Simplified74.4%
Taylor expanded in y around inf 77.7%
if -1.05e26 < y < 7.4999999999999996e96Initial program 95.0%
associate-*l/93.7%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in x around inf 70.7%
(FPCore (x y z t) :precision binary64 (if (<= y -2600000000000.0) t (if (<= y 4.2e-36) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2600000000000.0) {
tmp = t;
} else if (y <= 4.2e-36) {
tmp = t / (z / x);
} 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 (y <= (-2600000000000.0d0)) then
tmp = t
else if (y <= 4.2d-36) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2600000000000.0) {
tmp = t;
} else if (y <= 4.2e-36) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2600000000000.0: tmp = t elif y <= 4.2e-36: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2600000000000.0) tmp = t; elseif (y <= 4.2e-36) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2600000000000.0) tmp = t; elseif (y <= 4.2e-36) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2600000000000.0], t, If[LessEqual[y, 4.2e-36], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2600000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.6e12 or 4.19999999999999982e-36 < y Initial program 99.8%
associate-*l/75.3%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in y around inf 64.4%
if -2.6e12 < y < 4.19999999999999982e-36Initial program 93.7%
associate-*l/92.9%
associate-/l*91.4%
Simplified91.4%
associate-*r/92.9%
associate-*l/93.7%
*-commutative93.7%
clear-num93.6%
un-div-inv94.1%
Applied egg-rr94.1%
Taylor expanded in y around 0 70.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1100000000000.0) t (if (<= y 4.5e-38) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1100000000000.0) {
tmp = t;
} else if (y <= 4.5e-38) {
tmp = t * (x / 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 (y <= (-1100000000000.0d0)) then
tmp = t
else if (y <= 4.5d-38) then
tmp = t * (x / 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 (y <= -1100000000000.0) {
tmp = t;
} else if (y <= 4.5e-38) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1100000000000.0: tmp = t elif y <= 4.5e-38: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1100000000000.0) tmp = t; elseif (y <= 4.5e-38) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1100000000000.0) tmp = t; elseif (y <= 4.5e-38) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1100000000000.0], t, If[LessEqual[y, 4.5e-38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1100000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.1e12 or 4.50000000000000009e-38 < y Initial program 99.8%
associate-*l/75.3%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in y around inf 64.4%
if -1.1e12 < y < 4.50000000000000009e-38Initial program 93.7%
Taylor expanded in y around 0 70.0%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3000000000000.0) t (if (<= y 4.2e-36) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3000000000000.0) {
tmp = t;
} else if (y <= 4.2e-36) {
tmp = x * (t / 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 (y <= (-3000000000000.0d0)) then
tmp = t
else if (y <= 4.2d-36) then
tmp = x * (t / 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 (y <= -3000000000000.0) {
tmp = t;
} else if (y <= 4.2e-36) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3000000000000.0: tmp = t elif y <= 4.2e-36: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3000000000000.0) tmp = t; elseif (y <= 4.2e-36) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3000000000000.0) tmp = t; elseif (y <= 4.2e-36) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3000000000000.0], t, If[LessEqual[y, 4.2e-36], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3000000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3e12 or 4.19999999999999982e-36 < y Initial program 99.8%
associate-*l/75.3%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in y around inf 64.4%
if -3e12 < y < 4.19999999999999982e-36Initial program 93.7%
associate-*l/92.9%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in x around inf 75.3%
Taylor expanded in z around inf 64.8%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (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 - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 96.9%
Final simplification96.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 96.9%
associate-*l/83.9%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 37.8%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (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 - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))