
(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 97.5%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (- 1.0 (/ z y)))) (t_2 (* t (/ (- y x) y))))
(if (<= y -3.6e+78)
t_2
(if (<= y -3.8e-51)
t_1
(if (<= y 1.8e-66)
(/ x (/ (- z y) t))
(if (<= y 1.65e-23)
(* y (/ t (- y z)))
(if (<= y 4e+55) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - (z / y));
double t_2 = t * ((y - x) / y);
double tmp;
if (y <= -3.6e+78) {
tmp = t_2;
} else if (y <= -3.8e-51) {
tmp = t_1;
} else if (y <= 1.8e-66) {
tmp = x / ((z - y) / t);
} else if (y <= 1.65e-23) {
tmp = y * (t / (y - z));
} else if (y <= 4e+55) {
tmp = t_2;
} else {
tmp = t_1;
}
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 / (1.0d0 - (z / y))
t_2 = t * ((y - x) / y)
if (y <= (-3.6d+78)) then
tmp = t_2
else if (y <= (-3.8d-51)) then
tmp = t_1
else if (y <= 1.8d-66) then
tmp = x / ((z - y) / t)
else if (y <= 1.65d-23) then
tmp = y * (t / (y - z))
else if (y <= 4d+55) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - (z / y));
double t_2 = t * ((y - x) / y);
double tmp;
if (y <= -3.6e+78) {
tmp = t_2;
} else if (y <= -3.8e-51) {
tmp = t_1;
} else if (y <= 1.8e-66) {
tmp = x / ((z - y) / t);
} else if (y <= 1.65e-23) {
tmp = y * (t / (y - z));
} else if (y <= 4e+55) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (1.0 - (z / y)) t_2 = t * ((y - x) / y) tmp = 0 if y <= -3.6e+78: tmp = t_2 elif y <= -3.8e-51: tmp = t_1 elif y <= 1.8e-66: tmp = x / ((z - y) / t) elif y <= 1.65e-23: tmp = y * (t / (y - z)) elif y <= 4e+55: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(1.0 - Float64(z / y))) t_2 = Float64(t * Float64(Float64(y - x) / y)) tmp = 0.0 if (y <= -3.6e+78) tmp = t_2; elseif (y <= -3.8e-51) tmp = t_1; elseif (y <= 1.8e-66) tmp = Float64(x / Float64(Float64(z - y) / t)); elseif (y <= 1.65e-23) tmp = Float64(y * Float64(t / Float64(y - z))); elseif (y <= 4e+55) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (1.0 - (z / y)); t_2 = t * ((y - x) / y); tmp = 0.0; if (y <= -3.6e+78) tmp = t_2; elseif (y <= -3.8e-51) tmp = t_1; elseif (y <= 1.8e-66) tmp = x / ((z - y) / t); elseif (y <= 1.65e-23) tmp = y * (t / (y - z)); elseif (y <= 4e+55) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+78], t$95$2, If[LessEqual[y, -3.8e-51], t$95$1, If[LessEqual[y, 1.8e-66], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-23], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+55], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{1 - \frac{z}{y}}\\
t_2 := t \cdot \frac{y - x}{y}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+78}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{\frac{z - y}{t}}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-23}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.6000000000000002e78 or 1.6500000000000001e-23 < y < 4.00000000000000004e55Initial program 99.9%
Taylor expanded in z around 0 86.3%
associate-*r/86.3%
neg-mul-186.3%
neg-sub086.3%
associate--r-86.3%
neg-sub086.3%
Simplified86.3%
if -3.6000000000000002e78 < y < -3.80000000000000003e-51 or 4.00000000000000004e55 < y Initial program 99.8%
Taylor expanded in x around 0 82.0%
neg-mul-182.0%
distribute-neg-frac82.0%
Simplified82.0%
frac-2neg82.0%
div-inv81.9%
remove-double-neg81.9%
sub-neg81.9%
distribute-neg-in81.9%
remove-double-neg81.9%
Applied egg-rr81.9%
associate-*r/82.0%
*-rgt-identity82.0%
+-commutative82.0%
unsub-neg82.0%
Simplified82.0%
Taylor expanded in t around 0 62.6%
*-commutative62.6%
associate-/l*82.0%
div-sub82.1%
*-inverses82.1%
Simplified82.1%
if -3.80000000000000003e-51 < y < 1.80000000000000006e-66Initial program 94.1%
Taylor expanded in x around inf 85.9%
associate-/r/89.5%
Applied egg-rr89.5%
if 1.80000000000000006e-66 < y < 1.6500000000000001e-23Initial program 92.7%
Taylor expanded in x around 0 66.9%
neg-mul-166.9%
distribute-neg-frac66.9%
Simplified66.9%
frac-2neg66.9%
remove-double-neg66.9%
associate-*l/70.2%
sub-neg70.2%
distribute-neg-in70.2%
remove-double-neg70.2%
Applied egg-rr70.2%
*-commutative70.2%
associate-/l*65.9%
associate-/r/82.5%
+-commutative82.5%
unsub-neg82.5%
Simplified82.5%
Final simplification85.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.1e+214)
t
(if (or (<= y -0.03) (not (<= y 9.8e-67)))
(* y (/ t (- y z)))
(* (- x y) (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+214) {
tmp = t;
} else if ((y <= -0.03) || !(y <= 9.8e-67)) {
tmp = y * (t / (y - z));
} else {
tmp = (x - y) * (t / 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 <= (-1.1d+214)) then
tmp = t
else if ((y <= (-0.03d0)) .or. (.not. (y <= 9.8d-67))) then
tmp = y * (t / (y - z))
else
tmp = (x - y) * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+214) {
tmp = t;
} else if ((y <= -0.03) || !(y <= 9.8e-67)) {
tmp = y * (t / (y - z));
} else {
tmp = (x - y) * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e+214: tmp = t elif (y <= -0.03) or not (y <= 9.8e-67): tmp = y * (t / (y - z)) else: tmp = (x - y) * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e+214) tmp = t; elseif ((y <= -0.03) || !(y <= 9.8e-67)) tmp = Float64(y * Float64(t / Float64(y - z))); else tmp = Float64(Float64(x - y) * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e+214) tmp = t; elseif ((y <= -0.03) || ~((y <= 9.8e-67))) tmp = y * (t / (y - z)); else tmp = (x - y) * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e+214], t, If[Or[LessEqual[y, -0.03], N[Not[LessEqual[y, 9.8e-67]], $MachinePrecision]], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+214}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -0.03 \lor \neg \left(y \leq 9.8 \cdot 10^{-67}\right):\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -1.10000000000000012e214Initial program 100.0%
associate-*l/61.5%
associate-*r/65.3%
Simplified65.3%
Taylor expanded in y around inf 81.4%
if -1.10000000000000012e214 < y < -0.029999999999999999 or 9.79999999999999987e-67 < y Initial program 99.2%
Taylor expanded in x around 0 76.5%
neg-mul-176.5%
distribute-neg-frac76.5%
Simplified76.5%
frac-2neg76.5%
remove-double-neg76.5%
associate-*l/59.6%
sub-neg59.6%
distribute-neg-in59.6%
remove-double-neg59.6%
Applied egg-rr59.6%
*-commutative59.6%
associate-/l*76.5%
associate-/r/67.0%
+-commutative67.0%
unsub-neg67.0%
Simplified67.0%
if -0.029999999999999999 < y < 9.79999999999999987e-67Initial program 94.7%
associate-*l/95.1%
associate-*r/98.0%
Simplified98.0%
Taylor expanded in z around inf 81.8%
Final simplification73.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.2e+213)
t
(if (or (<= y -780000000000.0) (not (<= y 1.9e-66)))
(* y (/ t (- y z)))
(* t (/ x (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+213) {
tmp = t;
} else if ((y <= -780000000000.0) || !(y <= 1.9e-66)) {
tmp = y * (t / (y - z));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-7.2d+213)) then
tmp = t
else if ((y <= (-780000000000.0d0)) .or. (.not. (y <= 1.9d-66))) then
tmp = y * (t / (y - z))
else
tmp = t * (x / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+213) {
tmp = t;
} else if ((y <= -780000000000.0) || !(y <= 1.9e-66)) {
tmp = y * (t / (y - z));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e+213: tmp = t elif (y <= -780000000000.0) or not (y <= 1.9e-66): tmp = y * (t / (y - z)) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e+213) tmp = t; elseif ((y <= -780000000000.0) || !(y <= 1.9e-66)) tmp = Float64(y * Float64(t / Float64(y - z))); else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.2e+213) tmp = t; elseif ((y <= -780000000000.0) || ~((y <= 1.9e-66))) tmp = y * (t / (y - z)); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+213], t, If[Or[LessEqual[y, -780000000000.0], N[Not[LessEqual[y, 1.9e-66]], $MachinePrecision]], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+213}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -780000000000 \lor \neg \left(y \leq 1.9 \cdot 10^{-66}\right):\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -7.2000000000000002e213Initial program 100.0%
associate-*l/61.5%
associate-*r/65.3%
Simplified65.3%
Taylor expanded in y around inf 81.4%
if -7.2000000000000002e213 < y < -7.8e11 or 1.8999999999999999e-66 < y Initial program 99.2%
Taylor expanded in x around 0 77.3%
neg-mul-177.3%
distribute-neg-frac77.3%
Simplified77.3%
frac-2neg77.3%
remove-double-neg77.3%
associate-*l/59.9%
sub-neg59.9%
distribute-neg-in59.9%
remove-double-neg59.9%
Applied egg-rr59.9%
*-commutative59.9%
associate-/l*77.2%
associate-/r/67.4%
+-commutative67.4%
unsub-neg67.4%
Simplified67.4%
if -7.8e11 < y < 1.8999999999999999e-66Initial program 94.9%
Taylor expanded in x around inf 83.2%
Final simplification74.9%
(FPCore (x y z t) :precision binary64 (if (<= y -2.8e+78) (* t (/ (- y x) y)) (if (<= y 7.5e+205) (* (- x y) (/ t (- z y))) (/ t (- 1.0 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+78) {
tmp = t * ((y - x) / y);
} else if (y <= 7.5e+205) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t / (1.0 - (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 <= (-2.8d+78)) then
tmp = t * ((y - x) / y)
else if (y <= 7.5d+205) then
tmp = (x - y) * (t / (z - y))
else
tmp = t / (1.0d0 - (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+78) {
tmp = t * ((y - x) / y);
} else if (y <= 7.5e+205) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e+78: tmp = t * ((y - x) / y) elif y <= 7.5e+205: tmp = (x - y) * (t / (z - y)) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e+78) tmp = Float64(t * Float64(Float64(y - x) / y)); elseif (y <= 7.5e+205) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t / Float64(1.0 - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.8e+78) tmp = t * ((y - x) / y); elseif (y <= 7.5e+205) tmp = (x - y) * (t / (z - y)); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e+78], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+205], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+78}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+205}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.8000000000000001e78Initial program 99.9%
Taylor expanded in z around 0 90.5%
associate-*r/90.5%
neg-mul-190.5%
neg-sub090.5%
associate--r-90.5%
neg-sub090.5%
Simplified90.5%
if -2.8000000000000001e78 < y < 7.5000000000000003e205Initial program 96.7%
associate-*l/90.7%
associate-*r/94.1%
Simplified94.1%
if 7.5000000000000003e205 < y Initial program 99.9%
Taylor expanded in x around 0 95.3%
neg-mul-195.3%
distribute-neg-frac95.3%
Simplified95.3%
frac-2neg95.3%
div-inv95.0%
remove-double-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
Applied egg-rr95.0%
associate-*r/95.3%
*-rgt-identity95.3%
+-commutative95.3%
unsub-neg95.3%
Simplified95.3%
Taylor expanded in t around 0 36.6%
*-commutative36.6%
associate-/l*95.3%
div-sub95.3%
*-inverses95.3%
Simplified95.3%
Final simplification93.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.95e-52) (not (<= y 1.95e-66))) (* t (/ y (- y z))) (* t (/ x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.95e-52) || !(y <= 1.95e-66)) {
tmp = t * (y / (y - z));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.95d-52)) .or. (.not. (y <= 1.95d-66))) then
tmp = t * (y / (y - z))
else
tmp = t * (x / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.95e-52) || !(y <= 1.95e-66)) {
tmp = t * (y / (y - z));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.95e-52) or not (y <= 1.95e-66): tmp = t * (y / (y - z)) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.95e-52) || !(y <= 1.95e-66)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.95e-52) || ~((y <= 1.95e-66))) tmp = t * (y / (y - z)); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.95e-52], N[Not[LessEqual[y, 1.95e-66]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-52} \lor \neg \left(y \leq 1.95 \cdot 10^{-66}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -1.95000000000000009e-52 or 1.94999999999999991e-66 < y Initial program 99.4%
Taylor expanded in x around 0 77.6%
neg-mul-177.6%
distribute-neg-frac77.6%
Simplified77.6%
frac-2neg77.6%
div-inv77.5%
remove-double-neg77.5%
sub-neg77.5%
distribute-neg-in77.5%
remove-double-neg77.5%
Applied egg-rr77.5%
associate-*r/77.6%
*-rgt-identity77.6%
+-commutative77.6%
unsub-neg77.6%
Simplified77.6%
if -1.95000000000000009e-52 < y < 1.94999999999999991e-66Initial program 94.1%
Taylor expanded in x around inf 85.9%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (<= y -3.4e+66) t (if (<= y 1.55e-5) (* (- x y) (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e+66) {
tmp = t;
} else if (y <= 1.55e-5) {
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 <= (-3.4d+66)) then
tmp = t
else if (y <= 1.55d-5) 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 <= -3.4e+66) {
tmp = t;
} else if (y <= 1.55e-5) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.4e+66: tmp = t elif y <= 1.55e-5: tmp = (x - y) * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e+66) tmp = t; elseif (y <= 1.55e-5) 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 <= -3.4e+66) tmp = t; elseif (y <= 1.55e-5) tmp = (x - y) * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e+66], t, If[LessEqual[y, 1.55e-5], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+66}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-5}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.4000000000000003e66 or 1.55000000000000007e-5 < y Initial program 99.9%
associate-*l/70.5%
associate-*r/79.4%
Simplified79.4%
Taylor expanded in y around inf 63.7%
if -3.4000000000000003e66 < y < 1.55000000000000007e-5Initial program 95.5%
associate-*l/95.3%
associate-*r/97.0%
Simplified97.0%
Taylor expanded in z around inf 74.4%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e-50) (/ t (- 1.0 (/ z y))) (if (<= y 1.05e-66) (* t (/ x (- z y))) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-50) {
tmp = t / (1.0 - (z / y));
} else if (y <= 1.05e-66) {
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 (y <= (-1.3d-50)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 1.05d-66) 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 (y <= -1.3e-50) {
tmp = t / (1.0 - (z / y));
} else if (y <= 1.05e-66) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e-50: tmp = t / (1.0 - (z / y)) elif y <= 1.05e-66: tmp = t * (x / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e-50) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 1.05e-66) 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 (y <= -1.3e-50) tmp = t / (1.0 - (z / y)); elseif (y <= 1.05e-66) tmp = t * (x / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e-50], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-66], 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}\;y \leq -1.3 \cdot 10^{-50}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-66}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -1.3000000000000001e-50Initial program 99.8%
Taylor expanded in x around 0 78.1%
neg-mul-178.1%
distribute-neg-frac78.1%
Simplified78.1%
frac-2neg78.1%
div-inv78.0%
remove-double-neg78.0%
sub-neg78.0%
distribute-neg-in78.0%
remove-double-neg78.0%
Applied egg-rr78.0%
associate-*r/78.1%
*-rgt-identity78.1%
+-commutative78.1%
unsub-neg78.1%
Simplified78.1%
Taylor expanded in t around 0 65.3%
*-commutative65.3%
associate-/l*78.1%
div-sub78.1%
*-inverses78.1%
Simplified78.1%
if -1.3000000000000001e-50 < y < 1.05e-66Initial program 94.1%
Taylor expanded in x around inf 85.9%
if 1.05e-66 < y Initial program 98.8%
Taylor expanded in x around 0 77.1%
neg-mul-177.1%
distribute-neg-frac77.1%
Simplified77.1%
frac-2neg77.1%
div-inv77.0%
remove-double-neg77.0%
sub-neg77.0%
distribute-neg-in77.0%
remove-double-neg77.0%
Applied egg-rr77.0%
associate-*r/77.1%
*-rgt-identity77.1%
+-commutative77.1%
unsub-neg77.1%
Simplified77.1%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (<= y -7.4e-51) (/ t (- 1.0 (/ z y))) (if (<= y 1.95e-66) (/ x (/ (- z y) t)) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.4e-51) {
tmp = t / (1.0 - (z / y));
} else if (y <= 1.95e-66) {
tmp = x / ((z - y) / t);
} 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 <= (-7.4d-51)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 1.95d-66) then
tmp = x / ((z - y) / t)
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 <= -7.4e-51) {
tmp = t / (1.0 - (z / y));
} else if (y <= 1.95e-66) {
tmp = x / ((z - y) / t);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.4e-51: tmp = t / (1.0 - (z / y)) elif y <= 1.95e-66: tmp = x / ((z - y) / t) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.4e-51) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 1.95e-66) tmp = Float64(x / Float64(Float64(z - y) / t)); 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 <= -7.4e-51) tmp = t / (1.0 - (z / y)); elseif (y <= 1.95e-66) tmp = x / ((z - y) / t); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.4e-51], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-66], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-51}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{\frac{z - y}{t}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -7.39999999999999946e-51Initial program 99.8%
Taylor expanded in x around 0 78.1%
neg-mul-178.1%
distribute-neg-frac78.1%
Simplified78.1%
frac-2neg78.1%
div-inv78.0%
remove-double-neg78.0%
sub-neg78.0%
distribute-neg-in78.0%
remove-double-neg78.0%
Applied egg-rr78.0%
associate-*r/78.1%
*-rgt-identity78.1%
+-commutative78.1%
unsub-neg78.1%
Simplified78.1%
Taylor expanded in t around 0 65.3%
*-commutative65.3%
associate-/l*78.1%
div-sub78.1%
*-inverses78.1%
Simplified78.1%
if -7.39999999999999946e-51 < y < 1.94999999999999991e-66Initial program 94.1%
Taylor expanded in x around inf 85.9%
associate-/r/89.5%
Applied egg-rr89.5%
if 1.94999999999999991e-66 < y Initial program 98.8%
Taylor expanded in x around 0 77.1%
neg-mul-177.1%
distribute-neg-frac77.1%
Simplified77.1%
frac-2neg77.1%
div-inv77.0%
remove-double-neg77.0%
sub-neg77.0%
distribute-neg-in77.0%
remove-double-neg77.0%
Applied egg-rr77.0%
associate-*r/77.1%
*-rgt-identity77.1%
+-commutative77.1%
unsub-neg77.1%
Simplified77.1%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (<= y -6.8e-8) t (if (<= y 2.4e-120) (* x (/ t y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-8) {
tmp = t;
} else if (y <= 2.4e-120) {
tmp = x * (t / y);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.8d-8)) then
tmp = t
else if (y <= 2.4d-120) then
tmp = x * (t / y)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-8) {
tmp = t;
} else if (y <= 2.4e-120) {
tmp = x * (t / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e-8: tmp = t elif y <= 2.4e-120: tmp = x * (t / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e-8) tmp = t; elseif (y <= 2.4e-120) tmp = Float64(x * Float64(t / y)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e-8) tmp = t; elseif (y <= 2.4e-120) tmp = x * (t / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e-8], t, If[LessEqual[y, 2.4e-120], N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-8}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-120}:\\
\;\;\;\;x \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.8e-8 or 2.3999999999999999e-120 < y Initial program 99.3%
associate-*l/76.7%
associate-*r/83.9%
Simplified83.9%
Taylor expanded in y around inf 53.5%
if -6.8e-8 < y < 2.3999999999999999e-120Initial program 94.1%
Taylor expanded in x around inf 83.9%
Taylor expanded in z around 0 32.7%
associate-*r/32.7%
mul-1-neg32.7%
distribute-rgt-neg-out32.7%
Simplified32.7%
associate-/l*30.3%
associate-/r/31.5%
add-sqr-sqrt14.1%
sqrt-unprod23.3%
sqr-neg23.3%
sqrt-unprod8.9%
add-sqr-sqrt18.9%
Applied egg-rr18.9%
Final simplification41.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.4e+14) t (if (<= y 3.6e+14) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e+14) {
tmp = t;
} else if (y <= 3.6e+14) {
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 <= (-1.4d+14)) then
tmp = t
else if (y <= 3.6d+14) 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 <= -1.4e+14) {
tmp = t;
} else if (y <= 3.6e+14) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e+14: tmp = t elif y <= 3.6e+14: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e+14) tmp = t; elseif (y <= 3.6e+14) 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 <= -1.4e+14) tmp = t; elseif (y <= 3.6e+14) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e+14], t, If[LessEqual[y, 3.6e+14], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+14}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.4e14 or 3.6e14 < y Initial program 99.8%
associate-*l/73.2%
associate-*r/80.7%
Simplified80.7%
Taylor expanded in y around inf 61.1%
if -1.4e14 < y < 3.6e14Initial program 95.0%
clear-num93.7%
inv-pow93.7%
Applied egg-rr93.7%
unpow-193.7%
Simplified93.7%
Taylor expanded in y around 0 62.0%
associate-/l*63.4%
associate-/r/65.8%
Simplified65.8%
Final simplification63.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 97.5%
associate-*l/83.6%
associate-*r/88.7%
Simplified88.7%
Taylor expanded in y around inf 37.2%
Final simplification37.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 2023199
(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))