
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 96.5%
associate-*l/84.8%
associate-/l*82.6%
Simplified82.6%
associate-*r/84.8%
associate-*l/96.5%
*-commutative96.5%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (* x (/ t (- z y)))))
(if (<= x -35.0)
t_2
(if (<= x -5.8e-155)
t_1
(if (<= x -6.8e-177)
(* (- x y) (/ t z))
(if (<= x 1.12e-40) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = x * (t / (z - y));
double tmp;
if (x <= -35.0) {
tmp = t_2;
} else if (x <= -5.8e-155) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 1.12e-40) {
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 = x * (t / (z - y))
if (x <= (-35.0d0)) then
tmp = t_2
else if (x <= (-5.8d-155)) then
tmp = t_1
else if (x <= (-6.8d-177)) then
tmp = (x - y) * (t / z)
else if (x <= 1.12d-40) 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 = x * (t / (z - y));
double tmp;
if (x <= -35.0) {
tmp = t_2;
} else if (x <= -5.8e-155) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 1.12e-40) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = x * (t / (z - y)) tmp = 0 if x <= -35.0: tmp = t_2 elif x <= -5.8e-155: tmp = t_1 elif x <= -6.8e-177: tmp = (x - y) * (t / z) elif x <= 1.12e-40: 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(x * Float64(t / Float64(z - y))) tmp = 0.0 if (x <= -35.0) tmp = t_2; elseif (x <= -5.8e-155) tmp = t_1; elseif (x <= -6.8e-177) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (x <= 1.12e-40) 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 = x * (t / (z - y)); tmp = 0.0; if (x <= -35.0) tmp = t_2; elseif (x <= -5.8e-155) tmp = t_1; elseif (x <= -6.8e-177) tmp = (x - y) * (t / z); elseif (x <= 1.12e-40) 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[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -35.0], t$95$2, If[LessEqual[x, -5.8e-155], t$95$1, If[LessEqual[x, -6.8e-177], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.12e-40], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := x \cdot \frac{t}{z - y}\\
\mathbf{if}\;x \leq -35:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-177}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -35 or 1.1200000000000001e-40 < x Initial program 97.1%
associate-*l/84.4%
associate-/l*81.6%
Simplified81.6%
Taylor expanded in x around inf 69.1%
*-commutative69.1%
associate-/l*70.1%
Applied egg-rr70.1%
if -35 < x < -5.80000000000000021e-155 or -6.8000000000000001e-177 < x < 1.1200000000000001e-40Initial program 97.2%
Taylor expanded in x around 0 86.8%
neg-mul-186.8%
distribute-neg-frac286.8%
neg-sub086.8%
associate--r-86.8%
neg-sub086.8%
Simplified86.8%
Taylor expanded in t around 0 74.6%
associate-/l*86.8%
Simplified86.8%
if -5.80000000000000021e-155 < x < -6.8000000000000001e-177Initial program 72.6%
associate-*l/86.5%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
associate-/l*86.4%
Simplified86.4%
Final simplification77.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (* t (/ x (- z y)))))
(if (<= x -950000.0)
t_2
(if (<= x -5.8e-155)
t_1
(if (<= x -6.8e-177)
(* (- x y) (/ t z))
(if (<= x 4.3e-17) 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 <= -950000.0) {
tmp = t_2;
} else if (x <= -5.8e-155) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 4.3e-17) {
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 <= (-950000.0d0)) then
tmp = t_2
else if (x <= (-5.8d-155)) then
tmp = t_1
else if (x <= (-6.8d-177)) then
tmp = (x - y) * (t / z)
else if (x <= 4.3d-17) 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 <= -950000.0) {
tmp = t_2;
} else if (x <= -5.8e-155) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 4.3e-17) {
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 <= -950000.0: tmp = t_2 elif x <= -5.8e-155: tmp = t_1 elif x <= -6.8e-177: tmp = (x - y) * (t / z) elif x <= 4.3e-17: 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 <= -950000.0) tmp = t_2; elseif (x <= -5.8e-155) tmp = t_1; elseif (x <= -6.8e-177) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (x <= 4.3e-17) 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 <= -950000.0) tmp = t_2; elseif (x <= -5.8e-155) tmp = t_1; elseif (x <= -6.8e-177) tmp = (x - y) * (t / z); elseif (x <= 4.3e-17) 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, -950000.0], t$95$2, If[LessEqual[x, -5.8e-155], t$95$1, If[LessEqual[x, -6.8e-177], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e-17], 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 -950000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-177}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -9.5e5 or 4.30000000000000023e-17 < x Initial program 97.7%
Taylor expanded in x around inf 78.5%
if -9.5e5 < x < -5.80000000000000021e-155 or -6.8000000000000001e-177 < x < 4.30000000000000023e-17Initial program 96.4%
Taylor expanded in x around 0 85.6%
neg-mul-185.6%
distribute-neg-frac285.6%
neg-sub085.6%
associate--r-85.6%
neg-sub085.6%
Simplified85.6%
Taylor expanded in t around 0 73.8%
associate-/l*85.6%
Simplified85.6%
if -5.80000000000000021e-155 < x < -6.8000000000000001e-177Initial program 72.6%
associate-*l/86.5%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
associate-/l*86.4%
Simplified86.4%
Final simplification81.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= x -550000.0)
(* t (/ x (- z y)))
(if (<= x -1e-154)
t_1
(if (<= x -6.8e-177)
(* (- x y) (/ t z))
(if (<= x 2.15e-17) t_1 (/ t (/ (- z y) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (x <= -550000.0) {
tmp = t * (x / (z - y));
} else if (x <= -1e-154) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 2.15e-17) {
tmp = t_1;
} else {
tmp = t / ((z - 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) :: t_1
real(8) :: tmp
t_1 = t * (y / (y - z))
if (x <= (-550000.0d0)) then
tmp = t * (x / (z - y))
else if (x <= (-1d-154)) then
tmp = t_1
else if (x <= (-6.8d-177)) then
tmp = (x - y) * (t / z)
else if (x <= 2.15d-17) then
tmp = t_1
else
tmp = t / ((z - y) / x)
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 tmp;
if (x <= -550000.0) {
tmp = t * (x / (z - y));
} else if (x <= -1e-154) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 2.15e-17) {
tmp = t_1;
} else {
tmp = t / ((z - y) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) tmp = 0 if x <= -550000.0: tmp = t * (x / (z - y)) elif x <= -1e-154: tmp = t_1 elif x <= -6.8e-177: tmp = (x - y) * (t / z) elif x <= 2.15e-17: tmp = t_1 else: tmp = t / ((z - y) / x) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) tmp = 0.0 if (x <= -550000.0) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (x <= -1e-154) tmp = t_1; elseif (x <= -6.8e-177) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (x <= 2.15e-17) tmp = t_1; else tmp = Float64(t / Float64(Float64(z - y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); tmp = 0.0; if (x <= -550000.0) tmp = t * (x / (z - y)); elseif (x <= -1e-154) tmp = t_1; elseif (x <= -6.8e-177) tmp = (x - y) * (t / z); elseif (x <= 2.15e-17) tmp = t_1; else tmp = t / ((z - y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -550000.0], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-154], t$95$1, If[LessEqual[x, -6.8e-177], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.15e-17], t$95$1, N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;x \leq -550000:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-177}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\end{array}
\end{array}
if x < -5.5e5Initial program 98.3%
Taylor expanded in x around inf 78.0%
if -5.5e5 < x < -9.9999999999999997e-155 or -6.8000000000000001e-177 < x < 2.15000000000000012e-17Initial program 96.4%
Taylor expanded in x around 0 85.6%
neg-mul-185.6%
distribute-neg-frac285.6%
neg-sub085.6%
associate--r-85.6%
neg-sub085.6%
Simplified85.6%
Taylor expanded in t around 0 73.8%
associate-/l*85.6%
Simplified85.6%
if -9.9999999999999997e-155 < x < -6.8000000000000001e-177Initial program 72.6%
associate-*l/86.5%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
associate-/l*86.4%
Simplified86.4%
if 2.15000000000000012e-17 < x Initial program 97.3%
associate-*l/89.3%
associate-/l*76.4%
Simplified76.4%
associate-*r/89.3%
associate-*l/97.3%
*-commutative97.3%
clear-num97.2%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in x around inf 79.0%
Final simplification81.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= x -450.0)
(* t (* x (/ 1.0 (- z y))))
(if (<= x -5.8e-155)
t_1
(if (<= x -6.8e-177)
(* (- x y) (/ t z))
(if (<= x 8.2e-18) t_1 (/ t (/ (- z y) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (x <= -450.0) {
tmp = t * (x * (1.0 / (z - y)));
} else if (x <= -5.8e-155) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 8.2e-18) {
tmp = t_1;
} else {
tmp = t / ((z - 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) :: t_1
real(8) :: tmp
t_1 = t * (y / (y - z))
if (x <= (-450.0d0)) then
tmp = t * (x * (1.0d0 / (z - y)))
else if (x <= (-5.8d-155)) then
tmp = t_1
else if (x <= (-6.8d-177)) then
tmp = (x - y) * (t / z)
else if (x <= 8.2d-18) then
tmp = t_1
else
tmp = t / ((z - y) / x)
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 tmp;
if (x <= -450.0) {
tmp = t * (x * (1.0 / (z - y)));
} else if (x <= -5.8e-155) {
tmp = t_1;
} else if (x <= -6.8e-177) {
tmp = (x - y) * (t / z);
} else if (x <= 8.2e-18) {
tmp = t_1;
} else {
tmp = t / ((z - y) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) tmp = 0 if x <= -450.0: tmp = t * (x * (1.0 / (z - y))) elif x <= -5.8e-155: tmp = t_1 elif x <= -6.8e-177: tmp = (x - y) * (t / z) elif x <= 8.2e-18: tmp = t_1 else: tmp = t / ((z - y) / x) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) tmp = 0.0 if (x <= -450.0) tmp = Float64(t * Float64(x * Float64(1.0 / Float64(z - y)))); elseif (x <= -5.8e-155) tmp = t_1; elseif (x <= -6.8e-177) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (x <= 8.2e-18) tmp = t_1; else tmp = Float64(t / Float64(Float64(z - y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); tmp = 0.0; if (x <= -450.0) tmp = t * (x * (1.0 / (z - y))); elseif (x <= -5.8e-155) tmp = t_1; elseif (x <= -6.8e-177) tmp = (x - y) * (t / z); elseif (x <= 8.2e-18) tmp = t_1; else tmp = t / ((z - y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -450.0], N[(t * N[(x * N[(1.0 / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.8e-155], t$95$1, If[LessEqual[x, -6.8e-177], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e-18], t$95$1, N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;x \leq -450:\\
\;\;\;\;t \cdot \left(x \cdot \frac{1}{z - y}\right)\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-177}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\end{array}
\end{array}
if x < -450Initial program 98.3%
Taylor expanded in x around inf 78.0%
clear-num78.0%
associate-/r/78.1%
Applied egg-rr78.1%
if -450 < x < -5.80000000000000021e-155 or -6.8000000000000001e-177 < x < 8.1999999999999995e-18Initial program 96.4%
Taylor expanded in x around 0 85.6%
neg-mul-185.6%
distribute-neg-frac285.6%
neg-sub085.6%
associate--r-85.6%
neg-sub085.6%
Simplified85.6%
Taylor expanded in t around 0 73.8%
associate-/l*85.6%
Simplified85.6%
if -5.80000000000000021e-155 < x < -6.8000000000000001e-177Initial program 72.6%
associate-*l/86.5%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
associate-/l*86.4%
Simplified86.4%
if 8.1999999999999995e-18 < x Initial program 97.3%
associate-*l/89.3%
associate-/l*76.4%
Simplified76.4%
associate-*r/89.3%
associate-*l/97.3%
*-commutative97.3%
clear-num97.2%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in x around inf 79.0%
Final simplification81.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.82e+177) (not (<= y 1e+194))) (* t (/ y (- y z))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.82e+177) || !(y <= 1e+194)) {
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 <= (-1.82d+177)) .or. (.not. (y <= 1d+194))) 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 <= -1.82e+177) || !(y <= 1e+194)) {
tmp = t * (y / (y - z));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.82e+177) or not (y <= 1e+194): 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 <= -1.82e+177) || !(y <= 1e+194)) 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 <= -1.82e+177) || ~((y <= 1e+194))) 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, -1.82e+177], N[Not[LessEqual[y, 1e+194]], $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 -1.82 \cdot 10^{+177} \lor \neg \left(y \leq 10^{+194}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.82e177 or 9.99999999999999945e193 < y Initial program 99.8%
Taylor expanded in x around 0 89.1%
neg-mul-189.1%
distribute-neg-frac289.1%
neg-sub089.1%
associate--r-89.1%
neg-sub089.1%
Simplified89.1%
Taylor expanded in t around 0 59.8%
associate-/l*89.1%
Simplified89.1%
if -1.82e177 < y < 9.99999999999999945e193Initial program 95.8%
associate-*l/88.7%
associate-/l*88.5%
Simplified88.5%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -56000000000.0) (not (<= y 1.25))) (* t (/ y (- y z))) (/ t (/ z x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -56000000000.0) || !(y <= 1.25)) {
tmp = t * (y / (y - z));
} else {
tmp = t / (z / 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 <= (-56000000000.0d0)) .or. (.not. (y <= 1.25d0))) then
tmp = t * (y / (y - z))
else
tmp = t / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -56000000000.0) || !(y <= 1.25)) {
tmp = t * (y / (y - z));
} else {
tmp = t / (z / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -56000000000.0) or not (y <= 1.25): tmp = t * (y / (y - z)) else: tmp = t / (z / x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -56000000000.0) || !(y <= 1.25)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -56000000000.0) || ~((y <= 1.25))) tmp = t * (y / (y - z)); else tmp = t / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -56000000000.0], N[Not[LessEqual[y, 1.25]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -56000000000 \lor \neg \left(y \leq 1.25\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -5.6e10 or 1.25 < y Initial program 99.8%
Taylor expanded in x around 0 73.8%
neg-mul-173.8%
distribute-neg-frac273.8%
neg-sub073.8%
associate--r-73.8%
neg-sub073.8%
Simplified73.8%
Taylor expanded in t around 0 58.8%
associate-/l*73.8%
Simplified73.8%
if -5.6e10 < y < 1.25Initial program 92.9%
associate-*l/94.4%
associate-/l*91.6%
Simplified91.6%
associate-*r/94.4%
associate-*l/92.9%
*-commutative92.9%
clear-num92.8%
un-div-inv93.0%
Applied egg-rr93.0%
Taylor expanded in y around 0 64.5%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -900000.0) (not (<= x 1.3e-40))) (* x (/ t (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -900000.0) || !(x <= 1.3e-40)) {
tmp = x * (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 ((x <= (-900000.0d0)) .or. (.not. (x <= 1.3d-40))) then
tmp = x * (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 ((x <= -900000.0) || !(x <= 1.3e-40)) {
tmp = x * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -900000.0) or not (x <= 1.3e-40): tmp = x * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -900000.0) || !(x <= 1.3e-40)) tmp = Float64(x * 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 ((x <= -900000.0) || ~((x <= 1.3e-40))) tmp = x * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -900000.0], N[Not[LessEqual[x, 1.3e-40]], $MachinePrecision]], N[(x * 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}\;x \leq -900000 \lor \neg \left(x \leq 1.3 \cdot 10^{-40}\right):\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -9e5 or 1.3000000000000001e-40 < x Initial program 97.1%
associate-*l/84.4%
associate-/l*81.6%
Simplified81.6%
Taylor expanded in x around inf 69.1%
*-commutative69.1%
associate-/l*70.1%
Applied egg-rr70.1%
if -9e5 < x < 1.3000000000000001e-40Initial program 95.7%
Taylor expanded in x around 0 83.3%
neg-mul-183.3%
distribute-neg-frac283.3%
neg-sub083.3%
associate--r-83.3%
neg-sub083.3%
Simplified83.3%
Taylor expanded in t around 0 72.7%
associate-/l*83.3%
Simplified83.3%
Final simplification76.0%
(FPCore (x y z t) :precision binary64 (if (<= y -7000000000000.0) t (if (<= y 3.3e+24) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7000000000000.0) {
tmp = t;
} else if (y <= 3.3e+24) {
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 <= (-7000000000000.0d0)) then
tmp = t
else if (y <= 3.3d+24) 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 <= -7000000000000.0) {
tmp = t;
} else if (y <= 3.3e+24) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7000000000000.0: tmp = t elif y <= 3.3e+24: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7000000000000.0) tmp = t; elseif (y <= 3.3e+24) 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 <= -7000000000000.0) tmp = t; elseif (y <= 3.3e+24) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7000000000000.0], t, If[LessEqual[y, 3.3e+24], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7000000000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7e12 or 3.2999999999999999e24 < y Initial program 99.8%
associate-*l/75.0%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in y around inf 56.8%
if -7e12 < y < 3.2999999999999999e24Initial program 93.1%
associate-*l/94.6%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in y around 0 63.4%
*-commutative63.4%
associate-/l*62.8%
Simplified62.8%
Final simplification59.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.75e+29) t (if (<= y 1.25e+25) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.75e+29) {
tmp = t;
} else if (y <= 1.25e+25) {
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.75d+29)) then
tmp = t
else if (y <= 1.25d+25) 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.75e+29) {
tmp = t;
} else if (y <= 1.25e+25) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.75e+29: tmp = t elif y <= 1.25e+25: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.75e+29) tmp = t; elseif (y <= 1.25e+25) 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.75e+29) tmp = t; elseif (y <= 1.25e+25) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.75e+29], t, If[LessEqual[y, 1.25e+25], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+29}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+25}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.74999999999999989e29 or 1.25000000000000006e25 < y Initial program 99.8%
associate-*l/74.0%
associate-/l*73.8%
Simplified73.8%
Taylor expanded in y around inf 57.8%
if -1.74999999999999989e29 < y < 1.25000000000000006e25Initial program 93.4%
Taylor expanded in y around 0 64.0%
Final simplification61.0%
(FPCore (x y z t) :precision binary64 (if (<= y -3.7e+31) t (if (<= y 5e+25) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.7e+31) {
tmp = t;
} else if (y <= 5e+25) {
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 <= (-3.7d+31)) then
tmp = t
else if (y <= 5d+25) 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 <= -3.7e+31) {
tmp = t;
} else if (y <= 5e+25) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.7e+31: tmp = t elif y <= 5e+25: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.7e+31) tmp = t; elseif (y <= 5e+25) 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 <= -3.7e+31) tmp = t; elseif (y <= 5e+25) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.7e+31], t, If[LessEqual[y, 5e+25], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+31}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.6999999999999998e31 or 5.00000000000000024e25 < y Initial program 99.8%
associate-*l/74.0%
associate-/l*73.8%
Simplified73.8%
Taylor expanded in y around inf 57.8%
if -3.6999999999999998e31 < y < 5.00000000000000024e25Initial program 93.4%
associate-*l/94.7%
associate-/l*90.8%
Simplified90.8%
associate-*r/94.7%
associate-*l/93.4%
*-commutative93.4%
clear-num93.3%
un-div-inv93.4%
Applied egg-rr93.4%
Taylor expanded in y around 0 64.1%
Final simplification61.1%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * ((x - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 96.5%
associate-*l/84.8%
associate-/l*82.6%
Simplified82.6%
Taylor expanded in y around inf 34.9%
Final simplification34.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 2024095
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))