
(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 12 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.2%
associate-*l/88.7%
associate-*r/78.0%
Simplified78.0%
associate-*r/88.7%
associate-*l/97.2%
*-commutative97.2%
clear-num97.1%
un-div-inv97.2%
Applied egg-rr97.2%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t (- z y)))))
(if (<= y -3.5e+89)
t
(if (<= y -3e-61)
t_1
(if (<= y 1.8e-20)
(* (- x y) (/ t z))
(if (<= y 2.6e+58) t (if (<= y 5.1e+95) t_1 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z - y));
double tmp;
if (y <= -3.5e+89) {
tmp = t;
} else if (y <= -3e-61) {
tmp = t_1;
} else if (y <= 1.8e-20) {
tmp = (x - y) * (t / z);
} else if (y <= 2.6e+58) {
tmp = t;
} else if (y <= 5.1e+95) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t / (z - y))
if (y <= (-3.5d+89)) then
tmp = t
else if (y <= (-3d-61)) then
tmp = t_1
else if (y <= 1.8d-20) then
tmp = (x - y) * (t / z)
else if (y <= 2.6d+58) then
tmp = t
else if (y <= 5.1d+95) then
tmp = t_1
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z - y));
double tmp;
if (y <= -3.5e+89) {
tmp = t;
} else if (y <= -3e-61) {
tmp = t_1;
} else if (y <= 1.8e-20) {
tmp = (x - y) * (t / z);
} else if (y <= 2.6e+58) {
tmp = t;
} else if (y <= 5.1e+95) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z - y)) tmp = 0 if y <= -3.5e+89: tmp = t elif y <= -3e-61: tmp = t_1 elif y <= 1.8e-20: tmp = (x - y) * (t / z) elif y <= 2.6e+58: tmp = t elif y <= 5.1e+95: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / Float64(z - y))) tmp = 0.0 if (y <= -3.5e+89) tmp = t; elseif (y <= -3e-61) tmp = t_1; elseif (y <= 1.8e-20) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 2.6e+58) tmp = t; elseif (y <= 5.1e+95) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z - y)); tmp = 0.0; if (y <= -3.5e+89) tmp = t; elseif (y <= -3e-61) tmp = t_1; elseif (y <= 1.8e-20) tmp = (x - y) * (t / z); elseif (y <= 2.6e+58) tmp = t; elseif (y <= 5.1e+95) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+89], t, If[LessEqual[y, -3e-61], t$95$1, If[LessEqual[y, 1.8e-20], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+58], t, If[LessEqual[y, 5.1e+95], t$95$1, t]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z - y}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+89}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-20}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+58}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+95}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.5000000000000001e89 or 1.79999999999999987e-20 < y < 2.59999999999999988e58 or 5.10000000000000003e95 < y Initial program 99.8%
associate-*l/82.6%
associate-*r/64.3%
Simplified64.3%
Taylor expanded in y around inf 70.2%
if -3.5000000000000001e89 < y < -3.00000000000000012e-61 or 2.59999999999999988e58 < y < 5.10000000000000003e95Initial program 97.6%
associate-*l/87.6%
associate-*r/87.9%
Simplified87.9%
Taylor expanded in x around inf 51.2%
associate-*l/56.5%
*-commutative56.5%
Simplified56.5%
if -3.00000000000000012e-61 < y < 1.79999999999999987e-20Initial program 94.1%
associate-*l/95.9%
associate-*r/88.6%
Simplified88.6%
Taylor expanded in z around inf 78.6%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.8e+89)
t
(if (or (<= y 1.6e-20) (and (not (<= y 2.6e+64)) (<= y 4.9e+95)))
(* x (/ t (- z y)))
t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e+89) {
tmp = t;
} else if ((y <= 1.6e-20) || (!(y <= 2.6e+64) && (y <= 4.9e+95))) {
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 <= (-3.8d+89)) then
tmp = t
else if ((y <= 1.6d-20) .or. (.not. (y <= 2.6d+64)) .and. (y <= 4.9d+95)) 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 <= -3.8e+89) {
tmp = t;
} else if ((y <= 1.6e-20) || (!(y <= 2.6e+64) && (y <= 4.9e+95))) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.8e+89: tmp = t elif (y <= 1.6e-20) or (not (y <= 2.6e+64) and (y <= 4.9e+95)): tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e+89) tmp = t; elseif ((y <= 1.6e-20) || (!(y <= 2.6e+64) && (y <= 4.9e+95))) 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 <= -3.8e+89) tmp = t; elseif ((y <= 1.6e-20) || (~((y <= 2.6e+64)) && (y <= 4.9e+95))) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.8e+89], t, If[Or[LessEqual[y, 1.6e-20], And[N[Not[LessEqual[y, 2.6e+64]], $MachinePrecision], LessEqual[y, 4.9e+95]]], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+89}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-20} \lor \neg \left(y \leq 2.6 \cdot 10^{+64}\right) \land y \leq 4.9 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.80000000000000023e89 or 1.59999999999999985e-20 < y < 2.59999999999999997e64 or 4.8999999999999999e95 < y Initial program 99.8%
associate-*l/82.6%
associate-*r/64.3%
Simplified64.3%
Taylor expanded in y around inf 70.2%
if -3.80000000000000023e89 < y < 1.59999999999999985e-20 or 2.59999999999999997e64 < y < 4.8999999999999999e95Initial program 95.2%
associate-*l/93.3%
associate-*r/88.3%
Simplified88.3%
Taylor expanded in x around inf 66.1%
associate-*l/64.7%
*-commutative64.7%
Simplified64.7%
Final simplification67.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.2e+89)
t
(if (or (<= y 1.9e-20) (and (not (<= y 9.8e+61)) (<= y 1.05e+97)))
(* t (/ x (- z y)))
t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+89) {
tmp = t;
} else if ((y <= 1.9e-20) || (!(y <= 9.8e+61) && (y <= 1.05e+97))) {
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.2d+89)) then
tmp = t
else if ((y <= 1.9d-20) .or. (.not. (y <= 9.8d+61)) .and. (y <= 1.05d+97)) 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.2e+89) {
tmp = t;
} else if ((y <= 1.9e-20) || (!(y <= 9.8e+61) && (y <= 1.05e+97))) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e+89: tmp = t elif (y <= 1.9e-20) or (not (y <= 9.8e+61) and (y <= 1.05e+97)): tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e+89) tmp = t; elseif ((y <= 1.9e-20) || (!(y <= 9.8e+61) && (y <= 1.05e+97))) 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.2e+89) tmp = t; elseif ((y <= 1.9e-20) || (~((y <= 9.8e+61)) && (y <= 1.05e+97))) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+89], t, If[Or[LessEqual[y, 1.9e-20], And[N[Not[LessEqual[y, 9.8e+61]], $MachinePrecision], LessEqual[y, 1.05e+97]]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+89}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-20} \lor \neg \left(y \leq 9.8 \cdot 10^{+61}\right) \land y \leq 1.05 \cdot 10^{+97}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.2e89 or 1.8999999999999999e-20 < y < 9.8000000000000005e61 or 1.05000000000000006e97 < y Initial program 99.8%
associate-*l/82.6%
associate-*r/64.3%
Simplified64.3%
Taylor expanded in y around inf 70.2%
if -7.2e89 < y < 1.8999999999999999e-20 or 9.8000000000000005e61 < y < 1.05000000000000006e97Initial program 95.2%
Taylor expanded in x around inf 71.3%
Final simplification70.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.3e+89)
t
(if (<= y -3.4e+50)
(* x (- (/ t y)))
(if (<= y -2e+24) t (if (<= y 9e-22) (* t (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e+89) {
tmp = t;
} else if (y <= -3.4e+50) {
tmp = x * -(t / y);
} else if (y <= -2e+24) {
tmp = t;
} else if (y <= 9e-22) {
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 <= (-4.3d+89)) then
tmp = t
else if (y <= (-3.4d+50)) then
tmp = x * -(t / y)
else if (y <= (-2d+24)) then
tmp = t
else if (y <= 9d-22) 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 <= -4.3e+89) {
tmp = t;
} else if (y <= -3.4e+50) {
tmp = x * -(t / y);
} else if (y <= -2e+24) {
tmp = t;
} else if (y <= 9e-22) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.3e+89: tmp = t elif y <= -3.4e+50: tmp = x * -(t / y) elif y <= -2e+24: tmp = t elif y <= 9e-22: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.3e+89) tmp = t; elseif (y <= -3.4e+50) tmp = Float64(x * Float64(-Float64(t / y))); elseif (y <= -2e+24) tmp = t; elseif (y <= 9e-22) 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 <= -4.3e+89) tmp = t; elseif (y <= -3.4e+50) tmp = x * -(t / y); elseif (y <= -2e+24) tmp = t; elseif (y <= 9e-22) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.3e+89], t, If[LessEqual[y, -3.4e+50], N[(x * (-N[(t / y), $MachinePrecision])), $MachinePrecision], If[LessEqual[y, -2e+24], t, If[LessEqual[y, 9e-22], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+89}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{+50}:\\
\;\;\;\;x \cdot \left(-\frac{t}{y}\right)\\
\mathbf{elif}\;y \leq -2 \cdot 10^{+24}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-22}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.3000000000000002e89 or -3.3999999999999998e50 < y < -2e24 or 8.99999999999999973e-22 < y Initial program 99.8%
associate-*l/83.2%
associate-*r/66.1%
Simplified66.1%
Taylor expanded in y around inf 66.0%
if -4.3000000000000002e89 < y < -3.3999999999999998e50Initial program 99.6%
associate-*l/82.8%
associate-*r/94.7%
Simplified94.7%
Taylor expanded in x around inf 49.4%
associate-*l/66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in z around 0 54.2%
associate-*r/54.2%
neg-mul-154.2%
Simplified54.2%
if -2e24 < y < 8.99999999999999973e-22Initial program 94.2%
Taylor expanded in y around 0 63.6%
Final simplification64.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -7e+89)
t
(if (<= y -8.2e+49)
(/ (- t) (/ y x))
(if (<= y -2.3e+24) t (if (<= y 1.06e-21) (* t (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+89) {
tmp = t;
} else if (y <= -8.2e+49) {
tmp = -t / (y / x);
} else if (y <= -2.3e+24) {
tmp = t;
} else if (y <= 1.06e-21) {
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 <= (-7d+89)) then
tmp = t
else if (y <= (-8.2d+49)) then
tmp = -t / (y / x)
else if (y <= (-2.3d+24)) then
tmp = t
else if (y <= 1.06d-21) 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 <= -7e+89) {
tmp = t;
} else if (y <= -8.2e+49) {
tmp = -t / (y / x);
} else if (y <= -2.3e+24) {
tmp = t;
} else if (y <= 1.06e-21) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e+89: tmp = t elif y <= -8.2e+49: tmp = -t / (y / x) elif y <= -2.3e+24: tmp = t elif y <= 1.06e-21: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e+89) tmp = t; elseif (y <= -8.2e+49) tmp = Float64(Float64(-t) / Float64(y / x)); elseif (y <= -2.3e+24) tmp = t; elseif (y <= 1.06e-21) 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 <= -7e+89) tmp = t; elseif (y <= -8.2e+49) tmp = -t / (y / x); elseif (y <= -2.3e+24) tmp = t; elseif (y <= 1.06e-21) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e+89], t, If[LessEqual[y, -8.2e+49], N[((-t) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e+24], t, If[LessEqual[y, 1.06e-21], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+89}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{-t}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{+24}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-21}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.0000000000000001e89 or -8.2e49 < y < -2.2999999999999999e24 or 1.05999999999999994e-21 < y Initial program 99.8%
associate-*l/83.2%
associate-*r/66.1%
Simplified66.1%
Taylor expanded in y around inf 66.0%
if -7.0000000000000001e89 < y < -8.2e49Initial program 99.6%
associate-*l/82.8%
associate-*r/94.7%
Simplified94.7%
Taylor expanded in x around inf 49.4%
associate-*l/66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in z around 0 54.2%
associate-*r/54.2%
neg-mul-154.2%
Simplified54.2%
Taylor expanded in x around 0 45.3%
mul-1-neg45.3%
associate-/l*54.2%
distribute-neg-frac54.2%
Simplified54.2%
if -2.2999999999999999e24 < y < 1.05999999999999994e-21Initial program 94.2%
Taylor expanded in y around 0 63.6%
Final simplification64.4%
(FPCore (x y z t) :precision binary64 (if (<= y -6.8e+92) (/ t (/ (- y) (- x y))) (if (<= y 9.8e+148) (* (- x y) (/ t (- z y))) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+92) {
tmp = t / (-y / (x - y));
} else if (y <= 9.8e+148) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (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 (y <= (-6.8d+92)) then
tmp = t / (-y / (x - y))
else if (y <= 9.8d+148) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+92) {
tmp = t / (-y / (x - y));
} else if (y <= 9.8e+148) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e+92: tmp = t / (-y / (x - y)) elif y <= 9.8e+148: tmp = (x - y) * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e+92) tmp = Float64(t / Float64(Float64(-y) / Float64(x - y))); elseif (y <= 9.8e+148) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e+92) tmp = t / (-y / (x - y)); elseif (y <= 9.8e+148) tmp = (x - y) * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+92], N[(t / N[((-y) / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e+148], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{t}{\frac{-y}{x - y}}\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+148}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -6.7999999999999996e92Initial program 99.8%
associate-*l/83.1%
associate-*r/57.4%
Simplified57.4%
associate-*r/83.1%
associate-*l/99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 87.7%
neg-mul-187.7%
distribute-neg-frac87.7%
Simplified87.7%
if -6.7999999999999996e92 < y < 9.8e148Initial program 96.0%
associate-*l/92.9%
associate-*r/89.4%
Simplified89.4%
if 9.8e148 < y Initial program 99.9%
Taylor expanded in x around 0 90.6%
neg-mul-190.6%
distribute-neg-frac90.6%
Simplified90.6%
frac-2neg90.6%
div-inv90.4%
remove-double-neg90.4%
sub-neg90.4%
distribute-neg-in90.4%
remove-double-neg90.4%
Applied egg-rr90.4%
associate-*r/90.6%
*-rgt-identity90.6%
+-commutative90.6%
unsub-neg90.6%
Simplified90.6%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.25e+22) (not (<= x 1.6e+53))) (* t (/ x (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e+22) || !(x <= 1.6e+53)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.25d+22)) .or. (.not. (x <= 1.6d+53))) then
tmp = t * (x / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e+22) || !(x <= 1.6e+53)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.25e+22) or not (x <= 1.6e+53): tmp = t * (x / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.25e+22) || !(x <= 1.6e+53)) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.25e+22) || ~((x <= 1.6e+53))) tmp = t * (x / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.25e+22], N[Not[LessEqual[x, 1.6e+53]], $MachinePrecision]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+22} \lor \neg \left(x \leq 1.6 \cdot 10^{+53}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -1.2499999999999999e22 or 1.6e53 < x Initial program 97.9%
Taylor expanded in x around inf 77.6%
if -1.2499999999999999e22 < x < 1.6e53Initial program 96.7%
Taylor expanded in x around 0 80.8%
neg-mul-180.8%
distribute-neg-frac80.8%
Simplified80.8%
frac-2neg80.8%
div-inv80.7%
remove-double-neg80.7%
sub-neg80.7%
distribute-neg-in80.7%
remove-double-neg80.7%
Applied egg-rr80.7%
associate-*r/80.8%
*-rgt-identity80.8%
+-commutative80.8%
unsub-neg80.8%
Simplified80.8%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (<= y -3.3e+25) t (if (<= y 2.9e-107) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e+25) {
tmp = t;
} else if (y <= 2.9e-107) {
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.3d+25)) then
tmp = t
else if (y <= 2.9d-107) 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.3e+25) {
tmp = t;
} else if (y <= 2.9e-107) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e+25: tmp = t elif y <= 2.9e-107: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e+25) tmp = t; elseif (y <= 2.9e-107) 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.3e+25) tmp = t; elseif (y <= 2.9e-107) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e+25], t, If[LessEqual[y, 2.9e-107], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+25}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.3000000000000001e25 or 2.8999999999999998e-107 < y Initial program 99.8%
associate-*l/84.8%
associate-*r/70.3%
Simplified70.3%
Taylor expanded in y around inf 58.0%
if -3.3000000000000001e25 < y < 2.8999999999999998e-107Initial program 93.5%
associate-*l/94.4%
associate-*r/89.2%
Simplified89.2%
associate-*r/94.4%
associate-*l/93.5%
*-commutative93.5%
clear-num93.3%
un-div-inv93.4%
Applied egg-rr93.4%
Taylor expanded in y around 0 64.9%
associate-*l/65.0%
*-commutative65.0%
Simplified65.0%
Final simplification60.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.6e+26) t (if (<= y 8.4e-22) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e+26) {
tmp = t;
} else if (y <= 8.4e-22) {
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 <= (-1.6d+26)) then
tmp = t
else if (y <= 8.4d-22) 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 <= -1.6e+26) {
tmp = t;
} else if (y <= 8.4e-22) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e+26: tmp = t elif y <= 8.4e-22: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e+26) tmp = t; elseif (y <= 8.4e-22) 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 <= -1.6e+26) tmp = t; elseif (y <= 8.4e-22) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e+26], t, If[LessEqual[y, 8.4e-22], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+26}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-22}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.60000000000000014e26 or 8.40000000000000031e-22 < y Initial program 99.8%
associate-*l/83.2%
associate-*r/68.4%
Simplified68.4%
Taylor expanded in y around inf 61.9%
if -1.60000000000000014e26 < y < 8.40000000000000031e-22Initial program 94.2%
Taylor expanded in y around 0 63.6%
Final simplification62.7%
(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.2%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.2%
associate-*l/88.7%
associate-*r/78.0%
Simplified78.0%
Taylor expanded in y around inf 38.9%
Final simplification38.9%
(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 2023230
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))