
(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 9 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.9%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (<= y -7.2e+86) t (if (<= y -6.4e-60) (/ (* t (- x)) y) (if (<= y 1.9e-8) (/ t (/ z x)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+86) {
tmp = t;
} else if (y <= -6.4e-60) {
tmp = (t * -x) / y;
} else if (y <= 1.9e-8) {
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 <= (-7.2d+86)) then
tmp = t
else if (y <= (-6.4d-60)) then
tmp = (t * -x) / y
else if (y <= 1.9d-8) 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 <= -7.2e+86) {
tmp = t;
} else if (y <= -6.4e-60) {
tmp = (t * -x) / y;
} else if (y <= 1.9e-8) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e+86: tmp = t elif y <= -6.4e-60: tmp = (t * -x) / y elif y <= 1.9e-8: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e+86) tmp = t; elseif (y <= -6.4e-60) tmp = Float64(Float64(t * Float64(-x)) / y); elseif (y <= 1.9e-8) 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 <= -7.2e+86) tmp = t; elseif (y <= -6.4e-60) tmp = (t * -x) / y; elseif (y <= 1.9e-8) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+86], t, If[LessEqual[y, -6.4e-60], N[(N[(t * (-x)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 1.9e-8], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+86}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{-60}:\\
\;\;\;\;\frac{t \cdot \left(-x\right)}{y}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-8}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.20000000000000011e86 or 1.90000000000000014e-8 < y Initial program 99.8%
Taylor expanded in y around inf 68.2%
if -7.20000000000000011e86 < y < -6.4000000000000003e-60Initial program 99.7%
Taylor expanded in x around inf 52.2%
*-commutative52.2%
associate-*r/54.5%
Simplified54.5%
Taylor expanded in z around 0 41.7%
associate-*r/41.7%
mul-1-neg41.7%
distribute-lft-neg-out41.7%
*-commutative41.7%
Simplified41.7%
if -6.4000000000000003e-60 < y < 1.90000000000000014e-8Initial program 95.1%
Taylor expanded in y around 0 66.8%
associate-/l*74.8%
Simplified74.8%
Final simplification67.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.1e+54) (- t (* t (/ x y))) (if (<= y 8.8e-13) (* x (/ t (- z y))) (* t (- (/ y (- z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+54) {
tmp = t - (t * (x / y));
} else if (y <= 8.8e-13) {
tmp = x * (t / (z - y));
} else {
tmp = t * -(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 (y <= (-2.1d+54)) then
tmp = t - (t * (x / y))
else if (y <= 8.8d-13) then
tmp = x * (t / (z - y))
else
tmp = t * -(y / (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.1e+54) {
tmp = t - (t * (x / y));
} else if (y <= 8.8e-13) {
tmp = x * (t / (z - y));
} else {
tmp = t * -(y / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e+54: tmp = t - (t * (x / y)) elif y <= 8.8e-13: tmp = x * (t / (z - y)) else: tmp = t * -(y / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e+54) tmp = Float64(t - Float64(t * Float64(x / y))); elseif (y <= 8.8e-13) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(-Float64(y / Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e+54) tmp = t - (t * (x / y)); elseif (y <= 8.8e-13) tmp = x * (t / (z - y)); else tmp = t * -(y / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e+54], N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e-13], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * (-N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+54}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-\frac{y}{z - y}\right)\\
\end{array}
\end{array}
if y < -2.09999999999999986e54Initial program 99.8%
associate-/r/63.2%
div-inv63.1%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 65.9%
mul-1-neg65.9%
associate-/l*91.4%
distribute-neg-frac91.4%
Simplified91.4%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
*-commutative81.8%
associate-/l*83.1%
unsub-neg83.1%
associate-/r/91.4%
Simplified91.4%
if -2.09999999999999986e54 < y < 8.79999999999999986e-13Initial program 96.2%
Taylor expanded in x around inf 73.3%
*-commutative73.3%
associate-*r/81.2%
Simplified81.2%
if 8.79999999999999986e-13 < y Initial program 99.8%
Taylor expanded in x around 0 78.1%
neg-mul-178.1%
distribute-neg-frac78.1%
Simplified78.1%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= y -9e+53) (/ (- t) (/ y (- x y))) (if (<= y 1.26e-13) (* x (/ t (- z y))) (* t (- (/ y (- z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+53) {
tmp = -t / (y / (x - y));
} else if (y <= 1.26e-13) {
tmp = x * (t / (z - y));
} else {
tmp = t * -(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 (y <= (-9d+53)) then
tmp = -t / (y / (x - y))
else if (y <= 1.26d-13) then
tmp = x * (t / (z - y))
else
tmp = t * -(y / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+53) {
tmp = -t / (y / (x - y));
} else if (y <= 1.26e-13) {
tmp = x * (t / (z - y));
} else {
tmp = t * -(y / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e+53: tmp = -t / (y / (x - y)) elif y <= 1.26e-13: tmp = x * (t / (z - y)) else: tmp = t * -(y / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e+53) tmp = Float64(Float64(-t) / Float64(y / Float64(x - y))); elseif (y <= 1.26e-13) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(-Float64(y / Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e+53) tmp = -t / (y / (x - y)); elseif (y <= 1.26e-13) tmp = x * (t / (z - y)); else tmp = t * -(y / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e+53], N[((-t) / N[(y / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e-13], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * (-N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+53}:\\
\;\;\;\;\frac{-t}{\frac{y}{x - y}}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-\frac{y}{z - y}\right)\\
\end{array}
\end{array}
if y < -9.0000000000000004e53Initial program 99.8%
associate-/r/63.2%
div-inv63.1%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 65.9%
mul-1-neg65.9%
associate-/l*91.4%
distribute-neg-frac91.4%
Simplified91.4%
if -9.0000000000000004e53 < y < 1.25999999999999993e-13Initial program 96.2%
Taylor expanded in x around inf 73.3%
*-commutative73.3%
associate-*r/81.2%
Simplified81.2%
if 1.25999999999999993e-13 < y Initial program 99.8%
Taylor expanded in x around 0 78.1%
neg-mul-178.1%
distribute-neg-frac78.1%
Simplified78.1%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9e+53) (not (<= y 4.1e-11))) (- t (* t (/ x y))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+53) || !(y <= 4.1e-11)) {
tmp = t - (t * (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 <= (-9d+53)) .or. (.not. (y <= 4.1d-11))) then
tmp = t - (t * (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 <= -9e+53) || !(y <= 4.1e-11)) {
tmp = t - (t * (x / y));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9e+53) or not (y <= 4.1e-11): tmp = t - (t * (x / y)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9e+53) || !(y <= 4.1e-11)) tmp = Float64(t - Float64(t * 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 <= -9e+53) || ~((y <= 4.1e-11))) tmp = t - (t * (x / y)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e+53], N[Not[LessEqual[y, 4.1e-11]], $MachinePrecision]], N[(t - N[(t * 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 -9 \cdot 10^{+53} \lor \neg \left(y \leq 4.1 \cdot 10^{-11}\right):\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -9.0000000000000004e53 or 4.1000000000000001e-11 < y Initial program 99.8%
associate-/r/72.5%
div-inv72.4%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 60.8%
mul-1-neg60.8%
associate-/l*83.7%
distribute-neg-frac83.7%
Simplified83.7%
Taylor expanded in y around 0 76.8%
mul-1-neg76.8%
*-commutative76.8%
associate-/l*79.7%
unsub-neg79.7%
associate-/r/83.7%
Simplified83.7%
if -9.0000000000000004e53 < y < 4.1000000000000001e-11Initial program 96.2%
Taylor expanded in x around inf 73.5%
*-commutative73.5%
associate-*r/81.3%
Simplified81.3%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.15e+88) t (if (<= y 8.6e+104) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+88) {
tmp = t;
} else if (y <= 8.6e+104) {
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 <= (-1.15d+88)) then
tmp = t
else if (y <= 8.6d+104) 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 <= -1.15e+88) {
tmp = t;
} else if (y <= 8.6e+104) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e+88: tmp = t elif y <= 8.6e+104: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e+88) tmp = t; elseif (y <= 8.6e+104) 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 <= -1.15e+88) tmp = t; elseif (y <= 8.6e+104) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+88], t, If[LessEqual[y, 8.6e+104], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+88}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.1500000000000001e88 or 8.6000000000000003e104 < y Initial program 99.9%
Taylor expanded in y around inf 75.1%
if -1.1500000000000001e88 < y < 8.6000000000000003e104Initial program 96.8%
Taylor expanded in x around inf 68.4%
*-commutative68.4%
associate-*r/73.6%
Simplified73.6%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.6e+84) t (if (<= y 1.7e-8) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e+84) {
tmp = t;
} else if (y <= 1.7e-8) {
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.6d+84)) then
tmp = t
else if (y <= 1.7d-8) 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.6e+84) {
tmp = t;
} else if (y <= 1.7e-8) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e+84: tmp = t elif y <= 1.7e-8: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e+84) tmp = t; elseif (y <= 1.7e-8) 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.6e+84) tmp = t; elseif (y <= 1.7e-8) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e+84], t, If[LessEqual[y, 1.7e-8], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+84}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.60000000000000005e84 or 1.7e-8 < y Initial program 99.8%
Taylor expanded in y around inf 67.1%
if -1.60000000000000005e84 < y < 1.7e-8Initial program 96.3%
Taylor expanded in y around 0 55.8%
associate-/l*63.7%
associate-/r/63.2%
Simplified63.2%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (<= y -5.2e+84) t (if (<= y 1.4e-8) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e+84) {
tmp = t;
} else if (y <= 1.4e-8) {
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 <= (-5.2d+84)) then
tmp = t
else if (y <= 1.4d-8) 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 <= -5.2e+84) {
tmp = t;
} else if (y <= 1.4e-8) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e+84: tmp = t elif y <= 1.4e-8: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e+84) tmp = t; elseif (y <= 1.4e-8) 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 <= -5.2e+84) tmp = t; elseif (y <= 1.4e-8) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e+84], t, If[LessEqual[y, 1.4e-8], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+84}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.2000000000000002e84 or 1.4e-8 < y Initial program 99.8%
Taylor expanded in y around inf 67.1%
if -5.2000000000000002e84 < y < 1.4e-8Initial program 96.3%
Taylor expanded in y around 0 55.8%
associate-/l*63.7%
Simplified63.7%
Final simplification65.3%
(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.9%
Taylor expanded in y around inf 38.6%
Final simplification38.6%
(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 2024027
(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))