
(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 97.5%
associate-*l/82.2%
associate-/l*88.1%
Simplified88.1%
associate-*r/82.2%
associate-*l/97.5%
*-commutative97.5%
clear-num97.5%
un-div-inv97.8%
Applied egg-rr97.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+42)
(* t (/ y (- y z)))
(if (<= y -5e-135)
(* x (/ t (- z y)))
(if (<= y 2.2e+64) (* (- x y) (/ t z)) (/ t (/ y (- y x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+42) {
tmp = t * (y / (y - z));
} else if (y <= -5e-135) {
tmp = x * (t / (z - y));
} else if (y <= 2.2e+64) {
tmp = (x - y) * (t / z);
} else {
tmp = t / (y / (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 (y <= (-1.7d+42)) then
tmp = t * (y / (y - z))
else if (y <= (-5d-135)) then
tmp = x * (t / (z - y))
else if (y <= 2.2d+64) then
tmp = (x - y) * (t / z)
else
tmp = t / (y / (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+42) {
tmp = t * (y / (y - z));
} else if (y <= -5e-135) {
tmp = x * (t / (z - y));
} else if (y <= 2.2e+64) {
tmp = (x - y) * (t / z);
} else {
tmp = t / (y / (y - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+42: tmp = t * (y / (y - z)) elif y <= -5e-135: tmp = x * (t / (z - y)) elif y <= 2.2e+64: tmp = (x - y) * (t / z) else: tmp = t / (y / (y - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+42) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= -5e-135) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 2.2e+64) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = Float64(t / Float64(y / Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+42) tmp = t * (y / (y - z)); elseif (y <= -5e-135) tmp = x * (t / (z - y)); elseif (y <= 2.2e+64) tmp = (x - y) * (t / z); else tmp = t / (y / (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+42], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5e-135], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+64], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+42}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+64}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\end{array}
\end{array}
if y < -1.69999999999999988e42Initial program 99.8%
Taylor expanded in x around 0 80.8%
neg-mul-180.8%
distribute-neg-frac280.8%
neg-sub080.8%
sub-neg80.8%
+-commutative80.8%
associate--r+80.8%
neg-sub080.8%
remove-double-neg80.8%
Simplified80.8%
if -1.69999999999999988e42 < y < -5.0000000000000002e-135Initial program 99.8%
associate-*l/99.7%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around inf 71.8%
if -5.0000000000000002e-135 < y < 2.20000000000000002e64Initial program 95.0%
associate-*l/91.4%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 83.6%
if 2.20000000000000002e64 < y Initial program 99.8%
Taylor expanded in z around 0 81.1%
associate-*r/81.1%
neg-mul-181.1%
neg-sub081.1%
sub-neg81.1%
+-commutative81.1%
associate--r+81.1%
neg-sub081.1%
remove-double-neg81.1%
Simplified81.1%
*-commutative81.1%
clear-num81.1%
un-div-inv81.2%
Applied egg-rr81.2%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.9e+33)
(* t (/ y (- y z)))
(if (<= y -4.8e-135)
(* x (/ t (- z y)))
(if (<= y 9.8e+63) (* (- x y) (/ t z)) (* t (/ (- y x) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.9e+33) {
tmp = t * (y / (y - z));
} else if (y <= -4.8e-135) {
tmp = x * (t / (z - y));
} else if (y <= 9.8e+63) {
tmp = (x - y) * (t / z);
} else {
tmp = t * ((y - 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 (y <= (-4.9d+33)) then
tmp = t * (y / (y - z))
else if (y <= (-4.8d-135)) then
tmp = x * (t / (z - y))
else if (y <= 9.8d+63) then
tmp = (x - y) * (t / z)
else
tmp = t * ((y - x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.9e+33) {
tmp = t * (y / (y - z));
} else if (y <= -4.8e-135) {
tmp = x * (t / (z - y));
} else if (y <= 9.8e+63) {
tmp = (x - y) * (t / z);
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.9e+33: tmp = t * (y / (y - z)) elif y <= -4.8e-135: tmp = x * (t / (z - y)) elif y <= 9.8e+63: tmp = (x - y) * (t / z) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.9e+33) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= -4.8e-135) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 9.8e+63) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.9e+33) tmp = t * (y / (y - z)); elseif (y <= -4.8e-135) tmp = x * (t / (z - y)); elseif (y <= 9.8e+63) tmp = (x - y) * (t / z); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.9e+33], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.8e-135], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e+63], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+33}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+63}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -4.90000000000000014e33Initial program 99.8%
Taylor expanded in x around 0 80.8%
neg-mul-180.8%
distribute-neg-frac280.8%
neg-sub080.8%
sub-neg80.8%
+-commutative80.8%
associate--r+80.8%
neg-sub080.8%
remove-double-neg80.8%
Simplified80.8%
if -4.90000000000000014e33 < y < -4.7999999999999997e-135Initial program 99.8%
associate-*l/99.7%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around inf 71.8%
if -4.7999999999999997e-135 < y < 9.7999999999999994e63Initial program 95.0%
associate-*l/91.4%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 83.6%
if 9.7999999999999994e63 < y Initial program 99.8%
Taylor expanded in z around 0 81.1%
associate-*r/81.1%
neg-mul-181.1%
neg-sub081.1%
sub-neg81.1%
+-commutative81.1%
associate--r+81.1%
neg-sub081.1%
remove-double-neg81.1%
Simplified81.1%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (if (<= t 8.8e-226) (/ t (/ (- z y) x)) (if (<= t 6.2e-201) (/ (* t (- y x)) y) (* (- x y) (/ t (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.8e-226) {
tmp = t / ((z - y) / x);
} else if (t <= 6.2e-201) {
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 (t <= 8.8d-226) then
tmp = t / ((z - y) / x)
else if (t <= 6.2d-201) 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 (t <= 8.8e-226) {
tmp = t / ((z - y) / x);
} else if (t <= 6.2e-201) {
tmp = (t * (y - x)) / y;
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 8.8e-226: tmp = t / ((z - y) / x) elif t <= 6.2e-201: tmp = (t * (y - x)) / y else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 8.8e-226) tmp = Float64(t / Float64(Float64(z - y) / x)); elseif (t <= 6.2e-201) tmp = Float64(Float64(t * 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 (t <= 8.8e-226) tmp = t / ((z - y) / x); elseif (t <= 6.2e-201) tmp = (t * (y - x)) / y; else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 8.8e-226], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e-201], N[(N[(t * N[(y - x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.8 \cdot 10^{-226}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-201}:\\
\;\;\;\;\frac{t \cdot \left(y - x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if t < 8.8e-226Initial program 96.4%
associate-*l/84.0%
associate-/l*88.2%
Simplified88.2%
associate-*r/84.0%
associate-*l/96.4%
*-commutative96.4%
clear-num96.3%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in x around inf 61.6%
if 8.8e-226 < t < 6.1999999999999998e-201Initial program 100.0%
associate-*l/100.0%
associate-/l*21.3%
Simplified21.3%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
if 6.1999999999999998e-201 < t Initial program 98.9%
associate-*l/78.9%
associate-/l*91.6%
Simplified91.6%
Final simplification75.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.5e+30) (not (<= y 2.1e+128))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.5e+30) || !(y <= 2.1e+128)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (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 <= (-5.5d+30)) .or. (.not. (y <= 2.1d+128))) then
tmp = t * (y / (y - z))
else
tmp = x * (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 <= -5.5e+30) || !(y <= 2.1e+128)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.5e+30) or not (y <= 2.1e+128): tmp = t * (y / (y - z)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.5e+30) || !(y <= 2.1e+128)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.5e+30) || ~((y <= 2.1e+128))) tmp = t * (y / (y - z)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.5e+30], N[Not[LessEqual[y, 2.1e+128]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+30} \lor \neg \left(y \leq 2.1 \cdot 10^{+128}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -5.50000000000000025e30 or 2.1e128 < y Initial program 99.8%
Taylor expanded in x around 0 81.6%
neg-mul-181.6%
distribute-neg-frac281.6%
neg-sub081.6%
sub-neg81.6%
+-commutative81.6%
associate--r+81.6%
neg-sub081.6%
remove-double-neg81.6%
Simplified81.6%
if -5.50000000000000025e30 < y < 2.1e128Initial program 96.3%
associate-*l/92.1%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 76.6%
Final simplification78.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.35e+30) (* t (/ y (- y z))) (if (<= y 32500000.0) (/ t (/ (- z y) x)) (/ t (/ y (- y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+30) {
tmp = t * (y / (y - z));
} else if (y <= 32500000.0) {
tmp = t / ((z - y) / x);
} else {
tmp = t / (y / (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 (y <= (-1.35d+30)) then
tmp = t * (y / (y - z))
else if (y <= 32500000.0d0) then
tmp = t / ((z - y) / x)
else
tmp = t / (y / (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+30) {
tmp = t * (y / (y - z));
} else if (y <= 32500000.0) {
tmp = t / ((z - y) / x);
} else {
tmp = t / (y / (y - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e+30: tmp = t * (y / (y - z)) elif y <= 32500000.0: tmp = t / ((z - y) / x) else: tmp = t / (y / (y - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e+30) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 32500000.0) tmp = Float64(t / Float64(Float64(z - y) / x)); else tmp = Float64(t / Float64(y / Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.35e+30) tmp = t * (y / (y - z)); elseif (y <= 32500000.0) tmp = t / ((z - y) / x); else tmp = t / (y / (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e+30], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 32500000.0], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+30}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 32500000:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\end{array}
\end{array}
if y < -1.3499999999999999e30Initial program 99.8%
Taylor expanded in x around 0 80.8%
neg-mul-180.8%
distribute-neg-frac280.8%
neg-sub080.8%
sub-neg80.8%
+-commutative80.8%
associate--r+80.8%
neg-sub080.8%
remove-double-neg80.8%
Simplified80.8%
if -1.3499999999999999e30 < y < 3.25e7Initial program 95.9%
associate-*l/92.8%
associate-/l*94.5%
Simplified94.5%
associate-*r/92.8%
associate-*l/95.9%
*-commutative95.9%
clear-num95.8%
un-div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in x around inf 81.8%
if 3.25e7 < y Initial program 99.7%
Taylor expanded in z around 0 75.8%
associate-*r/75.8%
neg-mul-175.8%
neg-sub075.8%
sub-neg75.8%
+-commutative75.8%
associate--r+75.8%
neg-sub075.8%
remove-double-neg75.8%
Simplified75.8%
*-commutative75.8%
clear-num75.8%
un-div-inv75.9%
Applied egg-rr75.9%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= y -9e+35) (* y (/ t (- y z))) (if (<= y 6.2e+128) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+35) {
tmp = y * (t / (y - z));
} else if (y <= 6.2e+128) {
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 <= (-9d+35)) then
tmp = y * (t / (y - z))
else if (y <= 6.2d+128) 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 <= -9e+35) {
tmp = y * (t / (y - z));
} else if (y <= 6.2e+128) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e+35: tmp = y * (t / (y - z)) elif y <= 6.2e+128: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e+35) tmp = Float64(y * Float64(t / Float64(y - z))); elseif (y <= 6.2e+128) 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 <= -9e+35) tmp = y * (t / (y - z)); elseif (y <= 6.2e+128) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e+35], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+128], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+35}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.9999999999999993e35Initial program 99.8%
associate-*l/62.0%
associate-/l*78.7%
Simplified78.7%
Taylor expanded in x around 0 49.4%
associate-*r/49.4%
mul-1-neg49.4%
distribute-rgt-neg-out49.4%
associate-*l/66.7%
*-commutative66.7%
distribute-lft-neg-out66.7%
distribute-rgt-neg-in66.7%
distribute-frac-neg266.7%
neg-sub066.7%
sub-neg66.7%
+-commutative66.7%
associate--r+66.7%
neg-sub066.7%
remove-double-neg66.7%
Simplified66.7%
if -8.9999999999999993e35 < y < 6.20000000000000008e128Initial program 96.3%
associate-*l/92.1%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 76.6%
if 6.20000000000000008e128 < y Initial program 99.8%
associate-*l/65.3%
associate-/l*66.1%
Simplified66.1%
Taylor expanded in y around inf 70.4%
(FPCore (x y z t) :precision binary64 (if (<= y -7.6e+36) t (if (<= y 2.4e+128) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.6e+36) {
tmp = t;
} else if (y <= 2.4e+128) {
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 <= (-7.6d+36)) then
tmp = t
else if (y <= 2.4d+128) 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 <= -7.6e+36) {
tmp = t;
} else if (y <= 2.4e+128) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.6e+36: tmp = t elif y <= 2.4e+128: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.6e+36) tmp = t; elseif (y <= 2.4e+128) 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 <= -7.6e+36) tmp = t; elseif (y <= 2.4e+128) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+36], t, If[LessEqual[y, 2.4e+128], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+36}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.6000000000000005e36 or 2.4000000000000002e128 < y Initial program 99.8%
associate-*l/63.1%
associate-/l*74.4%
Simplified74.4%
Taylor expanded in y around inf 65.0%
if -7.6000000000000005e36 < y < 2.4000000000000002e128Initial program 96.3%
associate-*l/92.1%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 76.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.02e-16) t (if (<= y 2.1e+128) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e-16) {
tmp = t;
} else if (y <= 2.1e+128) {
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 <= (-1.02d-16)) then
tmp = t
else if (y <= 2.1d+128) 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 <= -1.02e-16) {
tmp = t;
} else if (y <= 2.1e+128) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e-16: tmp = t elif y <= 2.1e+128: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e-16) tmp = t; elseif (y <= 2.1e+128) 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 <= -1.02e-16) tmp = t; elseif (y <= 2.1e+128) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e-16], t, If[LessEqual[y, 2.1e+128], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-16}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+128}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.0200000000000001e-16 or 2.1e128 < y Initial program 99.8%
associate-*l/64.7%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in y around inf 64.4%
if -1.0200000000000001e-16 < y < 2.1e128Initial program 96.2%
associate-*l/91.9%
associate-/l*95.0%
Simplified95.0%
associate-*r/91.9%
associate-*l/96.2%
*-commutative96.2%
clear-num96.2%
un-div-inv96.7%
Applied egg-rr96.7%
Taylor expanded in y around 0 67.8%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e-14) t (if (<= y 2.1e+128) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-14) {
tmp = t;
} else if (y <= 2.1e+128) {
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 <= (-7.5d-14)) then
tmp = t
else if (y <= 2.1d+128) 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 <= -7.5e-14) {
tmp = t;
} else if (y <= 2.1e+128) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e-14: tmp = t elif y <= 2.1e+128: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e-14) tmp = t; elseif (y <= 2.1e+128) 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 <= -7.5e-14) tmp = t; elseif (y <= 2.1e+128) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e-14], t, If[LessEqual[y, 2.1e+128], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-14}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+128}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.4999999999999996e-14 or 2.1e128 < y Initial program 99.8%
associate-*l/64.7%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in y around inf 64.4%
if -7.4999999999999996e-14 < y < 2.1e128Initial program 96.2%
Taylor expanded in y around 0 67.4%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (<= y -3.4e-18) t (if (<= y 2.1e+128) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-18) {
tmp = t;
} else if (y <= 2.1e+128) {
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 <= (-3.4d-18)) then
tmp = t
else if (y <= 2.1d+128) 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 <= -3.4e-18) {
tmp = t;
} else if (y <= 2.1e+128) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.4e-18: tmp = t elif y <= 2.1e+128: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-18) tmp = t; elseif (y <= 2.1e+128) 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 <= -3.4e-18) tmp = t; elseif (y <= 2.1e+128) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-18], t, If[LessEqual[y, 2.1e+128], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-18}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.40000000000000001e-18 or 2.1e128 < y Initial program 99.8%
associate-*l/64.7%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in y around inf 64.4%
if -3.40000000000000001e-18 < y < 2.1e128Initial program 96.2%
associate-*l/91.9%
associate-/l*95.0%
Simplified95.0%
clear-num94.4%
un-div-inv95.1%
Applied egg-rr95.1%
Taylor expanded in y around 0 62.6%
associate-*l/65.6%
*-commutative65.6%
Simplified65.6%
(FPCore (x y z t) :precision binary64 (if (<= y -8.5e-160) t (if (<= y 7.5e-162) (* t (/ y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-160) {
tmp = t;
} else if (y <= 7.5e-162) {
tmp = t * (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 (y <= (-8.5d-160)) then
tmp = t
else if (y <= 7.5d-162) then
tmp = t * (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 (y <= -8.5e-160) {
tmp = t;
} else if (y <= 7.5e-162) {
tmp = t * (y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.5e-160: tmp = t elif y <= 7.5e-162: tmp = t * (y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e-160) tmp = t; elseif (y <= 7.5e-162) tmp = Float64(t * Float64(y / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.5e-160) tmp = t; elseif (y <= 7.5e-162) tmp = t * (y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.5e-160], t, If[LessEqual[y, 7.5e-162], N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-160}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-162}:\\
\;\;\;\;t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.49999999999999959e-160 or 7.49999999999999972e-162 < y Initial program 99.2%
associate-*l/78.6%
associate-/l*85.8%
Simplified85.8%
Taylor expanded in y around inf 41.5%
if -8.49999999999999959e-160 < y < 7.49999999999999972e-162Initial program 93.3%
associate-*l/91.1%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in x around 0 20.3%
associate-*r/20.3%
mul-1-neg20.3%
distribute-rgt-neg-out20.3%
associate-*l/24.0%
*-commutative24.0%
distribute-lft-neg-out24.0%
distribute-rgt-neg-in24.0%
distribute-frac-neg224.0%
neg-sub024.0%
sub-neg24.0%
+-commutative24.0%
associate--r+24.0%
neg-sub024.0%
remove-double-neg24.0%
Simplified24.0%
Taylor expanded in y around 0 20.2%
mul-1-neg20.2%
associate-/l*19.2%
distribute-rgt-neg-in19.2%
mul-1-neg19.2%
associate-*r/19.2%
neg-mul-119.2%
Simplified19.2%
clear-num19.2%
un-div-inv19.2%
add-sqr-sqrt10.8%
sqrt-unprod15.4%
sqr-neg15.4%
sqrt-unprod7.5%
add-sqr-sqrt15.8%
Applied egg-rr15.8%
associate-/r/22.2%
associate-*l/15.8%
associate-/l*15.8%
Simplified15.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 97.5%
Final simplification97.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 97.5%
associate-*l/82.2%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in y around inf 30.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 2024172
(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))