
(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 (* (/ (- 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}
Initial program 98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ x (- z y)))))
(if (<= y -2.55e+132)
t
(if (<= y 1.32e-217)
t_1
(if (<= y 6e-113) (* (- x y) (/ t z)) (if (<= y 0.054) t_1 t))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / (z - y));
double tmp;
if (y <= -2.55e+132) {
tmp = t;
} else if (y <= 1.32e-217) {
tmp = t_1;
} else if (y <= 6e-113) {
tmp = (x - y) * (t / z);
} else if (y <= 0.054) {
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 = t * (x / (z - y))
if (y <= (-2.55d+132)) then
tmp = t
else if (y <= 1.32d-217) then
tmp = t_1
else if (y <= 6d-113) then
tmp = (x - y) * (t / z)
else if (y <= 0.054d0) 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 = t * (x / (z - y));
double tmp;
if (y <= -2.55e+132) {
tmp = t;
} else if (y <= 1.32e-217) {
tmp = t_1;
} else if (y <= 6e-113) {
tmp = (x - y) * (t / z);
} else if (y <= 0.054) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / (z - y)) tmp = 0 if y <= -2.55e+132: tmp = t elif y <= 1.32e-217: tmp = t_1 elif y <= 6e-113: tmp = (x - y) * (t / z) elif y <= 0.054: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / Float64(z - y))) tmp = 0.0 if (y <= -2.55e+132) tmp = t; elseif (y <= 1.32e-217) tmp = t_1; elseif (y <= 6e-113) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 0.054) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (x / (z - y)); tmp = 0.0; if (y <= -2.55e+132) tmp = t; elseif (y <= 1.32e-217) tmp = t_1; elseif (y <= 6e-113) tmp = (x - y) * (t / z); elseif (y <= 0.054) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.55e+132], t, If[LessEqual[y, 1.32e-217], t$95$1, If[LessEqual[y, 6e-113], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.054], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;y \leq -2.55 \cdot 10^{+132}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-113}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 0.054:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.55e132 or 0.0539999999999999994 < y Initial program 99.9%
associate-*l/74.2%
associate-*r/78.5%
Simplified78.5%
Taylor expanded in y around inf 67.0%
if -2.55e132 < y < 1.32000000000000009e-217 or 6.0000000000000002e-113 < y < 0.0539999999999999994Initial program 98.3%
Taylor expanded in x around inf 76.8%
if 1.32000000000000009e-217 < y < 6.0000000000000002e-113Initial program 92.8%
associate-*l/86.4%
associate-*r/96.5%
Simplified96.5%
Taylor expanded in z around inf 93.8%
Final simplification74.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (* t (/ x (- z y)))))
(if (<= x -6e-19)
t_2
(if (<= x 1.75e-70)
t_1
(if (<= x 1.25e-16) (* (- x y) (/ t z)) (if (<= x 29000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t * (x / (z - y));
double tmp;
if (x <= -6e-19) {
tmp = t_2;
} else if (x <= 1.75e-70) {
tmp = t_1;
} else if (x <= 1.25e-16) {
tmp = (x - y) * (t / z);
} else if (x <= 29000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = t * (y / (y - z))
t_2 = t * (x / (z - y))
if (x <= (-6d-19)) then
tmp = t_2
else if (x <= 1.75d-70) then
tmp = t_1
else if (x <= 1.25d-16) then
tmp = (x - y) * (t / z)
else if (x <= 29000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t * (x / (z - y));
double tmp;
if (x <= -6e-19) {
tmp = t_2;
} else if (x <= 1.75e-70) {
tmp = t_1;
} else if (x <= 1.25e-16) {
tmp = (x - y) * (t / z);
} else if (x <= 29000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = t * (x / (z - y)) tmp = 0 if x <= -6e-19: tmp = t_2 elif x <= 1.75e-70: tmp = t_1 elif x <= 1.25e-16: tmp = (x - y) * (t / z) elif x <= 29000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) t_2 = Float64(t * Float64(x / Float64(z - y))) tmp = 0.0 if (x <= -6e-19) tmp = t_2; elseif (x <= 1.75e-70) tmp = t_1; elseif (x <= 1.25e-16) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (x <= 29000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); t_2 = t * (x / (z - y)); tmp = 0.0; if (x <= -6e-19) tmp = t_2; elseif (x <= 1.75e-70) tmp = t_1; elseif (x <= 1.25e-16) tmp = (x - y) * (t / z); elseif (x <= 29000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e-19], t$95$2, If[LessEqual[x, 1.75e-70], t$95$1, If[LessEqual[x, 1.25e-16], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 29000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;x \leq -6 \cdot 10^{-19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-16}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;x \leq 29000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -5.99999999999999985e-19 or 29000 < x Initial program 98.4%
Taylor expanded in x around inf 80.2%
if -5.99999999999999985e-19 < x < 1.74999999999999987e-70 or 1.2500000000000001e-16 < x < 29000Initial program 98.2%
Taylor expanded in x around 0 86.2%
neg-mul-186.2%
distribute-neg-frac86.2%
Simplified86.2%
frac-2neg86.2%
div-inv86.0%
remove-double-neg86.0%
sub-neg86.0%
distribute-neg-in86.0%
remove-double-neg86.0%
Applied egg-rr86.0%
associate-*r/86.2%
*-rgt-identity86.2%
+-commutative86.2%
unsub-neg86.2%
Simplified86.2%
if 1.74999999999999987e-70 < x < 1.2500000000000001e-16Initial program 99.8%
associate-*l/99.5%
associate-*r/99.5%
Simplified99.5%
Taylor expanded in z around inf 80.2%
Final simplification83.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (* t (/ x (- z y)))))
(if (<= x -9e-19)
t_2
(if (<= x 2.9e-65)
t_1
(if (<= x 8.5e-17)
(/ t (/ z (- x y)))
(if (<= x 6200000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t * (x / (z - y));
double tmp;
if (x <= -9e-19) {
tmp = t_2;
} else if (x <= 2.9e-65) {
tmp = t_1;
} else if (x <= 8.5e-17) {
tmp = t / (z / (x - y));
} else if (x <= 6200000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = t * (y / (y - z))
t_2 = t * (x / (z - y))
if (x <= (-9d-19)) then
tmp = t_2
else if (x <= 2.9d-65) then
tmp = t_1
else if (x <= 8.5d-17) then
tmp = t / (z / (x - y))
else if (x <= 6200000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t * (x / (z - y));
double tmp;
if (x <= -9e-19) {
tmp = t_2;
} else if (x <= 2.9e-65) {
tmp = t_1;
} else if (x <= 8.5e-17) {
tmp = t / (z / (x - y));
} else if (x <= 6200000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = t * (x / (z - y)) tmp = 0 if x <= -9e-19: tmp = t_2 elif x <= 2.9e-65: tmp = t_1 elif x <= 8.5e-17: tmp = t / (z / (x - y)) elif x <= 6200000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) t_2 = Float64(t * Float64(x / Float64(z - y))) tmp = 0.0 if (x <= -9e-19) tmp = t_2; elseif (x <= 2.9e-65) tmp = t_1; elseif (x <= 8.5e-17) tmp = Float64(t / Float64(z / Float64(x - y))); elseif (x <= 6200000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); t_2 = t * (x / (z - y)); tmp = 0.0; if (x <= -9e-19) tmp = t_2; elseif (x <= 2.9e-65) tmp = t_1; elseif (x <= 8.5e-17) tmp = t / (z / (x - y)); elseif (x <= 6200000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e-19], t$95$2, If[LessEqual[x, 2.9e-65], t$95$1, If[LessEqual[x, 8.5e-17], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6200000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;x \leq -9 \cdot 10^{-19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\mathbf{elif}\;x \leq 6200000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -9.00000000000000026e-19 or 6.2e6 < x Initial program 98.4%
Taylor expanded in x around inf 80.2%
if -9.00000000000000026e-19 < x < 2.8999999999999998e-65 or 8.5e-17 < x < 6.2e6Initial program 98.2%
Taylor expanded in x around 0 86.2%
neg-mul-186.2%
distribute-neg-frac86.2%
Simplified86.2%
frac-2neg86.2%
div-inv86.0%
remove-double-neg86.0%
sub-neg86.0%
distribute-neg-in86.0%
remove-double-neg86.0%
Applied egg-rr86.0%
associate-*r/86.2%
*-rgt-identity86.2%
+-commutative86.2%
unsub-neg86.2%
Simplified86.2%
if 2.8999999999999998e-65 < x < 8.5e-17Initial program 99.8%
associate-*l/99.5%
associate-*r/99.5%
Simplified99.5%
Taylor expanded in z around inf 80.3%
associate-/l*80.3%
Simplified80.3%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.65e+248) (not (<= y 2.4e+128))) (* t (/ y (- y z))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.65e+248) || !(y <= 2.4e+128)) {
tmp = t * (y / (y - z));
} 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 <= (-3.65d+248)) .or. (.not. (y <= 2.4d+128))) then
tmp = t * (y / (y - z))
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 <= -3.65e+248) || !(y <= 2.4e+128)) {
tmp = t * (y / (y - z));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.65e+248) or not (y <= 2.4e+128): tmp = t * (y / (y - z)) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.65e+248) || !(y <= 2.4e+128)) tmp = Float64(t * Float64(y / Float64(y - z))); 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 <= -3.65e+248) || ~((y <= 2.4e+128))) tmp = t * (y / (y - z)); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.65e+248], N[Not[LessEqual[y, 2.4e+128]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $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 -3.65 \cdot 10^{+248} \lor \neg \left(y \leq 2.4 \cdot 10^{+128}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -3.6499999999999999e248 or 2.4000000000000002e128 < y Initial program 100.0%
Taylor expanded in x around 0 92.0%
neg-mul-192.0%
distribute-neg-frac92.0%
Simplified92.0%
frac-2neg92.0%
div-inv91.7%
remove-double-neg91.7%
sub-neg91.7%
distribute-neg-in91.7%
remove-double-neg91.7%
Applied egg-rr91.7%
associate-*r/92.0%
*-rgt-identity92.0%
+-commutative92.0%
unsub-neg92.0%
Simplified92.0%
if -3.6499999999999999e248 < y < 2.4000000000000002e128Initial program 98.0%
associate-*l/87.4%
associate-*r/94.8%
Simplified94.8%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (if (<= y -6.6e+85) t (if (<= y 0.0006) (* (- x y) (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e+85) {
tmp = t;
} else if (y <= 0.0006) {
tmp = (x - y) * (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 <= (-6.6d+85)) then
tmp = t
else if (y <= 0.0006d0) then
tmp = (x - y) * (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 <= -6.6e+85) {
tmp = t;
} else if (y <= 0.0006) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.6e+85: tmp = t elif y <= 0.0006: tmp = (x - y) * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.6e+85) tmp = t; elseif (y <= 0.0006) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.6e+85) tmp = t; elseif (y <= 0.0006) tmp = (x - y) * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e+85], t, If[LessEqual[y, 0.0006], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+85}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.0006:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.5999999999999998e85 or 5.99999999999999947e-4 < y Initial program 99.9%
associate-*l/77.2%
associate-*r/80.1%
Simplified80.1%
Taylor expanded in y around inf 63.9%
if -6.5999999999999998e85 < y < 5.99999999999999947e-4Initial program 97.1%
associate-*l/89.9%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in z around inf 76.2%
Final simplification70.8%
(FPCore (x y z t) :precision binary64 (if (<= z -2e+71) (* (- x y) (/ t z)) (if (<= z 1.6e-58) (* t (/ (- y x) y)) (/ t (/ z (- x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+71) {
tmp = (x - y) * (t / z);
} else if (z <= 1.6e-58) {
tmp = t * ((y - x) / y);
} else {
tmp = t / (z / (x - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2d+71)) then
tmp = (x - y) * (t / z)
else if (z <= 1.6d-58) then
tmp = t * ((y - x) / y)
else
tmp = t / (z / (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+71) {
tmp = (x - y) * (t / z);
} else if (z <= 1.6e-58) {
tmp = t * ((y - x) / y);
} else {
tmp = t / (z / (x - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e+71: tmp = (x - y) * (t / z) elif z <= 1.6e-58: tmp = t * ((y - x) / y) else: tmp = t / (z / (x - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e+71) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (z <= 1.6e-58) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = Float64(t / Float64(z / Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e+71) tmp = (x - y) * (t / z); elseif (z <= 1.6e-58) tmp = t * ((y - x) / y); else tmp = t / (z / (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e+71], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-58], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+71}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-58}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e71Initial program 97.8%
associate-*l/79.1%
associate-*r/90.9%
Simplified90.9%
Taylor expanded in z around inf 89.0%
if -2.0000000000000001e71 < z < 1.6e-58Initial program 99.3%
Taylor expanded in z around 0 79.7%
associate-*r/79.7%
neg-mul-179.7%
neg-sub079.7%
associate--r-79.7%
neg-sub079.7%
Simplified79.7%
if 1.6e-58 < z Initial program 96.9%
associate-*l/88.5%
associate-*r/88.0%
Simplified88.0%
Taylor expanded in z around inf 75.5%
associate-/l*81.5%
Simplified81.5%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (if (<= y -5.2e-186) t (if (<= y 0.00092) (* y (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e-186) {
tmp = t;
} else if (y <= 0.00092) {
tmp = y * (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 <= (-5.2d-186)) then
tmp = t
else if (y <= 0.00092d0) then
tmp = y * (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 <= -5.2e-186) {
tmp = t;
} else if (y <= 0.00092) {
tmp = y * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e-186: tmp = t elif y <= 0.00092: tmp = y * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e-186) tmp = t; elseif (y <= 0.00092) tmp = Float64(y * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.2e-186) tmp = t; elseif (y <= 0.00092) tmp = y * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e-186], t, If[LessEqual[y, 0.00092], N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-186}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00092:\\
\;\;\;\;y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.19999999999999986e-186 or 9.2000000000000003e-4 < y Initial program 99.9%
associate-*l/80.6%
associate-*r/85.0%
Simplified85.0%
Taylor expanded in y around inf 51.8%
if -5.19999999999999986e-186 < y < 9.2000000000000003e-4Initial program 95.7%
Taylor expanded in x around 0 26.9%
neg-mul-126.9%
distribute-neg-frac26.9%
Simplified26.9%
Taylor expanded in y around 0 26.2%
mul-1-neg26.2%
distribute-neg-frac26.2%
Simplified26.2%
expm1-log1p-u25.4%
expm1-udef19.3%
associate-*l/19.3%
add-sqr-sqrt4.8%
sqrt-unprod17.4%
sqr-neg17.4%
sqrt-unprod12.5%
add-sqr-sqrt17.4%
Applied egg-rr17.4%
expm1-def17.3%
expm1-log1p17.6%
associate-*r/21.7%
Simplified21.7%
Final simplification40.7%
(FPCore (x y z t) :precision binary64 (if (<= y -2.3e+84) t (if (<= y 0.05) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e+84) {
tmp = t;
} else if (y <= 0.05) {
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 <= (-2.3d+84)) then
tmp = t
else if (y <= 0.05d0) 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 <= -2.3e+84) {
tmp = t;
} else if (y <= 0.05) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e+84: tmp = t elif y <= 0.05: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e+84) tmp = t; elseif (y <= 0.05) 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 <= -2.3e+84) tmp = t; elseif (y <= 0.05) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e+84], t, If[LessEqual[y, 0.05], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+84}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.05:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.2999999999999999e84 or 0.050000000000000003 < y Initial program 99.9%
associate-*l/77.2%
associate-*r/80.1%
Simplified80.1%
Taylor expanded in y around inf 63.9%
if -2.2999999999999999e84 < y < 0.050000000000000003Initial program 97.1%
associate-*l/89.9%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in y around 0 61.0%
associate-/l*66.5%
associate-/r/65.0%
Applied egg-rr65.0%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.3e+84) t (if (<= y 0.014) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e+84) {
tmp = t;
} else if (y <= 0.014) {
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 <= (-2.3d+84)) then
tmp = t
else if (y <= 0.014d0) 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 <= -2.3e+84) {
tmp = t;
} else if (y <= 0.014) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e+84: tmp = t elif y <= 0.014: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e+84) tmp = t; elseif (y <= 0.014) 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 <= -2.3e+84) tmp = t; elseif (y <= 0.014) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e+84], t, If[LessEqual[y, 0.014], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+84}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.014:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.2999999999999999e84 or 0.0140000000000000003 < y Initial program 99.9%
associate-*l/77.2%
associate-*r/80.1%
Simplified80.1%
Taylor expanded in y around inf 63.9%
if -2.2999999999999999e84 < y < 0.0140000000000000003Initial program 97.1%
Taylor expanded in y around 0 66.0%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e+84) t (if (<= y 0.0006) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e+84) {
tmp = t;
} else if (y <= 0.0006) {
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 <= (-2.5d+84)) then
tmp = t
else if (y <= 0.0006d0) 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 <= -2.5e+84) {
tmp = t;
} else if (y <= 0.0006) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e+84: tmp = t elif y <= 0.0006: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e+84) tmp = t; elseif (y <= 0.0006) 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 <= -2.5e+84) tmp = t; elseif (y <= 0.0006) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e+84], t, If[LessEqual[y, 0.0006], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+84}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.0006:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.5e84 or 5.99999999999999947e-4 < y Initial program 99.9%
associate-*l/77.2%
associate-*r/80.1%
Simplified80.1%
Taylor expanded in y around inf 63.9%
if -2.5e84 < y < 5.99999999999999947e-4Initial program 97.1%
associate-*l/89.9%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in y around 0 61.0%
associate-/l*66.5%
Simplified66.5%
Final simplification65.4%
(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 98.3%
associate-*l/84.3%
associate-*r/88.7%
Simplified88.7%
Taylor expanded in y around inf 34.2%
Final simplification34.2%
(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 2023195
(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))