
(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 (if (<= (/ (- x y) (- z y)) -4e+240) (* x (/ t (- z y))) (* t (- (/ x (- z y)) (/ y (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - y) / (z - y)) <= -4e+240) {
tmp = x * (t / (z - y));
} else {
tmp = t * ((x / (z - y)) - (y / (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 (((x - y) / (z - y)) <= (-4d+240)) then
tmp = x * (t / (z - y))
else
tmp = t * ((x / (z - y)) - (y / (z - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x - y) / (z - y)) <= -4e+240) {
tmp = x * (t / (z - y));
} else {
tmp = t * ((x / (z - y)) - (y / (z - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x - y) / (z - y)) <= -4e+240: tmp = x * (t / (z - y)) else: tmp = t * ((x / (z - y)) - (y / (z - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x - y) / Float64(z - y)) <= -4e+240) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(Float64(x / Float64(z - y)) - Float64(y / Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x - y) / (z - y)) <= -4e+240) tmp = x * (t / (z - y)); else tmp = t * ((x / (z - y)) - (y / (z - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], -4e+240], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \leq -4 \cdot 10^{+240}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -4.00000000000000006e240Initial program 60.7%
Taylor expanded in x around inf 99.9%
*-commutative99.9%
associate-*r/100.0%
Simplified100.0%
if -4.00000000000000006e240 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.8%
div-sub97.8%
Applied egg-rr97.8%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -9.5e+78)
t
(if (<= y -850000000.0)
(/ x (/ (- y) t))
(if (<= y 4.7e+38) (* t (/ x z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+78) {
tmp = t;
} else if (y <= -850000000.0) {
tmp = x / (-y / t);
} else if (y <= 4.7e+38) {
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 <= (-9.5d+78)) then
tmp = t
else if (y <= (-850000000.0d0)) then
tmp = x / (-y / t)
else if (y <= 4.7d+38) 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 <= -9.5e+78) {
tmp = t;
} else if (y <= -850000000.0) {
tmp = x / (-y / t);
} else if (y <= 4.7e+38) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.5e+78: tmp = t elif y <= -850000000.0: tmp = x / (-y / t) elif y <= 4.7e+38: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e+78) tmp = t; elseif (y <= -850000000.0) tmp = Float64(x / Float64(Float64(-y) / t)); elseif (y <= 4.7e+38) 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 <= -9.5e+78) tmp = t; elseif (y <= -850000000.0) tmp = x / (-y / t); elseif (y <= 4.7e+38) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e+78], t, If[LessEqual[y, -850000000.0], N[(x / N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+78}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -850000000:\\
\;\;\;\;\frac{x}{\frac{-y}{t}}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -9.5000000000000006e78 or 4.6999999999999999e38 < y Initial program 99.8%
Taylor expanded in y around inf 72.3%
if -9.5000000000000006e78 < y < -8.5e8Initial program 99.8%
Taylor expanded in x around inf 68.8%
*-commutative68.8%
associate-*r/68.7%
Simplified68.7%
Taylor expanded in z around 0 68.8%
mul-1-neg68.8%
*-commutative68.8%
associate-*r/68.7%
distribute-rgt-neg-in68.7%
distribute-frac-neg68.7%
Simplified68.7%
frac-2neg68.7%
remove-double-neg68.7%
associate-*r/68.8%
Applied egg-rr68.8%
associate-/l*68.8%
Simplified68.8%
if -8.5e8 < y < 4.6999999999999999e38Initial program 93.6%
Taylor expanded in y around 0 69.5%
Final simplification70.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (- x y) (- z y)))) (if (<= t_1 -4e+240) (* x (/ t (- z y))) (* t_1 t))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -4e+240) {
tmp = x * (t / (z - y));
} else {
tmp = t_1 * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= (-4d+240)) then
tmp = x * (t / (z - y))
else
tmp = t_1 * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -4e+240) {
tmp = x * (t / (z - y));
} else {
tmp = t_1 * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= -4e+240: tmp = x * (t / (z - y)) else: tmp = t_1 * t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= -4e+240) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t_1 * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= -4e+240) tmp = x * (t / (z - y)); else tmp = t_1 * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+240], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+240}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot t\\
\end{array}
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -4.00000000000000006e240Initial program 60.7%
Taylor expanded in x around inf 99.9%
*-commutative99.9%
associate-*r/100.0%
Simplified100.0%
if -4.00000000000000006e240 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.8%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.5e+46) (not (<= y 1.45e+37))) (* t (- 1.0 (/ x y))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.5e+46) || !(y <= 1.45e+37)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-6.5d+46)) .or. (.not. (y <= 1.45d+37))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.5e+46) || !(y <= 1.45e+37)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.5e+46) or not (y <= 1.45e+37): tmp = t * (1.0 - (x / y)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.5e+46) || !(y <= 1.45e+37)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.5e+46) || ~((y <= 1.45e+37))) tmp = t * (1.0 - (x / y)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.5e+46], N[Not[LessEqual[y, 1.45e+37]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+46} \lor \neg \left(y \leq 1.45 \cdot 10^{+37}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -6.50000000000000008e46 or 1.44999999999999989e37 < y Initial program 99.9%
div-sub99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
if -6.50000000000000008e46 < y < 1.44999999999999989e37Initial program 93.8%
Taylor expanded in x around inf 79.0%
*-commutative79.0%
associate-*r/77.1%
Simplified77.1%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.2e+48) (not (<= y 8.2e+37))) (* t (- 1.0 (/ x y))) (* t (/ x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.2e+48) || !(y <= 8.2e+37)) {
tmp = t * (1.0 - (x / y));
} 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 <= (-8.2d+48)) .or. (.not. (y <= 8.2d+37))) then
tmp = t * (1.0d0 - (x / y))
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 <= -8.2e+48) || !(y <= 8.2e+37)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.2e+48) or not (y <= 8.2e+37): tmp = t * (1.0 - (x / y)) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.2e+48) || !(y <= 8.2e+37)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); 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 <= -8.2e+48) || ~((y <= 8.2e+37))) tmp = t * (1.0 - (x / y)); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.2e+48], N[Not[LessEqual[y, 8.2e+37]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+48} \lor \neg \left(y \leq 8.2 \cdot 10^{+37}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -8.2000000000000005e48 or 8.1999999999999996e37 < y Initial program 99.9%
div-sub99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
if -8.2000000000000005e48 < y < 8.1999999999999996e37Initial program 93.8%
Taylor expanded in x around inf 77.7%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.75e+79) t (if (<= y 3.7e+38) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.75e+79) {
tmp = t;
} else if (y <= 3.7e+38) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.75d+79)) then
tmp = t
else if (y <= 3.7d+38) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.75e+79) {
tmp = t;
} else if (y <= 3.7e+38) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.75e+79: tmp = t elif y <= 3.7e+38: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.75e+79) tmp = t; elseif (y <= 3.7e+38) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.75e+79) tmp = t; elseif (y <= 3.7e+38) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.75e+79], t, If[LessEqual[y, 3.7e+38], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{+79}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.75000000000000003e79 or 3.7000000000000001e38 < y Initial program 99.8%
Taylor expanded in y around inf 72.3%
if -2.75000000000000003e79 < y < 3.7000000000000001e38Initial program 94.1%
Taylor expanded in x around inf 78.2%
*-commutative78.2%
associate-*r/76.4%
Simplified76.4%
Final simplification75.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.15e+49) (* t (- 1.0 (/ x y))) (if (<= y 3.2e+38) (* t (/ x (- z y))) (/ t (- 1.0 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.15e+49) {
tmp = t * (1.0 - (x / y));
} else if (y <= 3.2e+38) {
tmp = t * (x / (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.15d+49)) then
tmp = t * (1.0d0 - (x / y))
else if (y <= 3.2d+38) then
tmp = t * (x / (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.15e+49) {
tmp = t * (1.0 - (x / y));
} else if (y <= 3.2e+38) {
tmp = t * (x / (z - y));
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.15e+49: tmp = t * (1.0 - (x / y)) elif y <= 3.2e+38: tmp = t * (x / (z - y)) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.15e+49) tmp = Float64(t * Float64(1.0 - Float64(x / y))); elseif (y <= 3.2e+38) tmp = Float64(t * Float64(x / 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.15e+49) tmp = t * (1.0 - (x / y)); elseif (y <= 3.2e+38) tmp = t * (x / (z - y)); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.15e+49], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+38], N[(t * N[(x / 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.15 \cdot 10^{+49}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.15e49Initial program 99.9%
div-sub99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
if -2.15e49 < y < 3.19999999999999985e38Initial program 93.8%
Taylor expanded in x around inf 77.8%
if 3.19999999999999985e38 < y Initial program 99.8%
Taylor expanded in x around 0 64.1%
mul-1-neg64.1%
associate-/l*84.0%
distribute-neg-frac84.0%
div-sub84.0%
*-inverses84.0%
Simplified84.0%
frac-2neg84.0%
div-inv83.9%
remove-double-neg83.9%
sub-neg83.9%
metadata-eval83.9%
distribute-neg-in83.9%
metadata-eval83.9%
Applied egg-rr83.9%
associate-*r/84.0%
*-rgt-identity84.0%
+-commutative84.0%
unsub-neg84.0%
Simplified84.0%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e+46) (* t (- 1.0 (/ x y))) (if (<= y 3.9e+38) (/ (* x t) (- z y)) (/ t (- 1.0 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+46) {
tmp = t * (1.0 - (x / y));
} else if (y <= 3.9e+38) {
tmp = (x * 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 <= (-5.5d+46)) then
tmp = t * (1.0d0 - (x / y))
else if (y <= 3.9d+38) then
tmp = (x * 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 <= -5.5e+46) {
tmp = t * (1.0 - (x / y));
} else if (y <= 3.9e+38) {
tmp = (x * t) / (z - y);
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e+46: tmp = t * (1.0 - (x / y)) elif y <= 3.9e+38: tmp = (x * t) / (z - y) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e+46) tmp = Float64(t * Float64(1.0 - Float64(x / y))); elseif (y <= 3.9e+38) tmp = Float64(Float64(x * 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 <= -5.5e+46) tmp = t * (1.0 - (x / y)); elseif (y <= 3.9e+38) tmp = (x * t) / (z - y); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e+46], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+38], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+38}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if y < -5.4999999999999998e46Initial program 99.9%
div-sub99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
if -5.4999999999999998e46 < y < 3.90000000000000023e38Initial program 93.8%
Taylor expanded in x around inf 79.1%
if 3.90000000000000023e38 < y Initial program 99.8%
Taylor expanded in x around 0 64.1%
mul-1-neg64.1%
associate-/l*84.0%
distribute-neg-frac84.0%
div-sub84.0%
*-inverses84.0%
Simplified84.0%
frac-2neg84.0%
div-inv83.9%
remove-double-neg83.9%
sub-neg83.9%
metadata-eval83.9%
distribute-neg-in83.9%
metadata-eval83.9%
Applied egg-rr83.9%
associate-*r/84.0%
*-rgt-identity84.0%
+-commutative84.0%
unsub-neg84.0%
Simplified84.0%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (<= y -5.4e-118) t (if (<= y 6.5e-142) (* t (/ y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.4e-118) {
tmp = t;
} else if (y <= 6.5e-142) {
tmp = t * (y / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.4d-118)) then
tmp = t
else if (y <= 6.5d-142) then
tmp = t * (y / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.4e-118) {
tmp = t;
} else if (y <= 6.5e-142) {
tmp = t * (y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.4e-118: tmp = t elif y <= 6.5e-142: tmp = t * (y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.4e-118) tmp = t; elseif (y <= 6.5e-142) tmp = Float64(t * Float64(y / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.4e-118) tmp = t; elseif (y <= 6.5e-142) tmp = t * (y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e-118], t, If[LessEqual[y, 6.5e-142], N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-118}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-142}:\\
\;\;\;\;t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.39999999999999988e-118 or 6.50000000000000027e-142 < y Initial program 98.1%
Taylor expanded in y around inf 46.8%
if -5.39999999999999988e-118 < y < 6.50000000000000027e-142Initial program 92.1%
Taylor expanded in z around inf 85.2%
Taylor expanded in x around 0 29.6%
associate-*r/29.6%
associate-*r*29.6%
neg-mul-129.6%
Simplified29.6%
expm1-log1p-u27.1%
expm1-udef24.8%
associate-/l*24.8%
add-sqr-sqrt13.5%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod11.3%
add-sqr-sqrt24.8%
Applied egg-rr24.8%
expm1-def24.8%
expm1-log1p25.0%
associate-/l*25.0%
associate-*r/25.0%
Simplified25.0%
Final simplification39.2%
(FPCore (x y z t) :precision binary64 (if (<= y -2e+47) t (if (<= y 2.55e+38) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e+47) {
tmp = t;
} else if (y <= 2.55e+38) {
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 <= (-2d+47)) then
tmp = t
else if (y <= 2.55d+38) 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 <= -2e+47) {
tmp = t;
} else if (y <= 2.55e+38) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e+47: tmp = t elif y <= 2.55e+38: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e+47) tmp = t; elseif (y <= 2.55e+38) 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 <= -2e+47) tmp = t; elseif (y <= 2.55e+38) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e+47], t, If[LessEqual[y, 2.55e+38], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+47}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.0000000000000001e47 or 2.5500000000000001e38 < y Initial program 99.8%
Taylor expanded in y around inf 69.9%
if -2.0000000000000001e47 < y < 2.5500000000000001e38Initial program 93.8%
Taylor expanded in y around 0 66.7%
associate-/l*67.7%
associate-/r/65.1%
Simplified65.1%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.3e+48) t (if (<= y 1.95e+38) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e+48) {
tmp = t;
} else if (y <= 1.95e+38) {
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+48)) then
tmp = t
else if (y <= 1.95d+38) 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+48) {
tmp = t;
} else if (y <= 1.95e+38) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e+48: tmp = t elif y <= 1.95e+38: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e+48) tmp = t; elseif (y <= 1.95e+38) 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+48) tmp = t; elseif (y <= 1.95e+38) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e+48], t, If[LessEqual[y, 1.95e+38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+48}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.3e48 or 1.95000000000000012e38 < y Initial program 99.8%
Taylor expanded in y around inf 69.9%
if -2.3e48 < y < 1.95000000000000012e38Initial program 93.8%
Taylor expanded in y around 0 68.2%
Final simplification68.8%
(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.0%
Taylor expanded in y around inf 31.9%
Final simplification31.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 2024021
(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))