
(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 14 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.9%
associate-*l/86.2%
associate-/l*86.4%
Simplified86.4%
associate-*r/86.2%
associate-*l/96.9%
*-commutative96.9%
clear-num96.8%
un-div-inv97.1%
Applied egg-rr97.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.4e+89) t (if (<= y -2.8e-95) (/ (* t (- y)) z) (if (<= y 5.4e-24) (/ (* t x) z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e+89) {
tmp = t;
} else if (y <= -2.8e-95) {
tmp = (t * -y) / z;
} else if (y <= 5.4e-24) {
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.4d+89)) then
tmp = t
else if (y <= (-2.8d-95)) then
tmp = (t * -y) / z
else if (y <= 5.4d-24) 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.4e+89) {
tmp = t;
} else if (y <= -2.8e-95) {
tmp = (t * -y) / z;
} else if (y <= 5.4e-24) {
tmp = (t * x) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e+89: tmp = t elif y <= -2.8e-95: tmp = (t * -y) / z elif y <= 5.4e-24: tmp = (t * x) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e+89) tmp = t; elseif (y <= -2.8e-95) tmp = Float64(Float64(t * Float64(-y)) / z); elseif (y <= 5.4e-24) tmp = Float64(Float64(t * x) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e+89) tmp = t; elseif (y <= -2.8e-95) tmp = (t * -y) / z; elseif (y <= 5.4e-24) tmp = (t * x) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e+89], t, If[LessEqual[y, -2.8e-95], N[(N[(t * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 5.4e-24], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+89}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-95}:\\
\;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-24}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.3999999999999999e89 or 5.40000000000000014e-24 < y Initial program 99.9%
associate-*l/74.3%
associate-/l*78.4%
Simplified78.4%
Taylor expanded in y around inf 62.4%
if -1.3999999999999999e89 < y < -2.7999999999999999e-95Initial program 97.8%
Taylor expanded in z around inf 62.2%
Taylor expanded in x around 0 48.7%
associate-*r/48.7%
mul-1-neg48.7%
distribute-rgt-neg-out48.7%
Simplified48.7%
if -2.7999999999999999e-95 < y < 5.40000000000000014e-24Initial program 93.2%
associate-*l/94.2%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 67.1%
(FPCore (x y z t) :precision binary64 (if (<= y -8e+88) t (if (<= y -4.4e-95) (/ t (/ z (- y))) (if (<= y 5.4e-24) (/ (* t x) z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8e+88) {
tmp = t;
} else if (y <= -4.4e-95) {
tmp = t / (z / -y);
} else if (y <= 5.4e-24) {
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 <= (-8d+88)) then
tmp = t
else if (y <= (-4.4d-95)) then
tmp = t / (z / -y)
else if (y <= 5.4d-24) 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 <= -8e+88) {
tmp = t;
} else if (y <= -4.4e-95) {
tmp = t / (z / -y);
} else if (y <= 5.4e-24) {
tmp = (t * x) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8e+88: tmp = t elif y <= -4.4e-95: tmp = t / (z / -y) elif y <= 5.4e-24: tmp = (t * x) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8e+88) tmp = t; elseif (y <= -4.4e-95) tmp = Float64(t / Float64(z / Float64(-y))); elseif (y <= 5.4e-24) tmp = Float64(Float64(t * x) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8e+88) tmp = t; elseif (y <= -4.4e-95) tmp = t / (z / -y); elseif (y <= 5.4e-24) tmp = (t * x) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8e+88], t, If[LessEqual[y, -4.4e-95], N[(t / N[(z / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-24], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+88}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-95}:\\
\;\;\;\;\frac{t}{\frac{z}{-y}}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-24}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.99999999999999968e88 or 5.40000000000000014e-24 < y Initial program 99.9%
associate-*l/74.3%
associate-/l*78.4%
Simplified78.4%
Taylor expanded in y around inf 62.4%
if -7.99999999999999968e88 < y < -4.3999999999999998e-95Initial program 97.8%
associate-*l/95.9%
associate-/l*97.7%
Simplified97.7%
associate-*r/95.9%
associate-*l/97.8%
*-commutative97.8%
clear-num97.8%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in z around inf 62.3%
Taylor expanded in x around 0 48.6%
associate-*r/48.6%
neg-mul-148.6%
Simplified48.6%
if -4.3999999999999998e-95 < y < 5.40000000000000014e-24Initial program 93.2%
associate-*l/94.2%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 67.1%
Final simplification61.6%
(FPCore (x y z t) :precision binary64 (if (<= y -7.6e+88) t (if (<= y -4.3e-95) (* t (/ y (- z))) (if (<= y 7.5e-24) (/ (* t x) z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.6e+88) {
tmp = t;
} else if (y <= -4.3e-95) {
tmp = t * (y / -z);
} else if (y <= 7.5e-24) {
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 <= (-7.6d+88)) then
tmp = t
else if (y <= (-4.3d-95)) then
tmp = t * (y / -z)
else if (y <= 7.5d-24) 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 <= -7.6e+88) {
tmp = t;
} else if (y <= -4.3e-95) {
tmp = t * (y / -z);
} else if (y <= 7.5e-24) {
tmp = (t * x) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.6e+88: tmp = t elif y <= -4.3e-95: tmp = t * (y / -z) elif y <= 7.5e-24: tmp = (t * x) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.6e+88) tmp = t; elseif (y <= -4.3e-95) tmp = Float64(t * Float64(y / Float64(-z))); elseif (y <= 7.5e-24) tmp = Float64(Float64(t * x) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.6e+88) tmp = t; elseif (y <= -4.3e-95) tmp = t * (y / -z); elseif (y <= 7.5e-24) tmp = (t * x) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+88], t, If[LessEqual[y, -4.3e-95], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-24], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+88}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.5999999999999993e88 or 7.50000000000000007e-24 < y Initial program 99.9%
associate-*l/74.3%
associate-/l*78.4%
Simplified78.4%
Taylor expanded in y around inf 62.4%
if -7.5999999999999993e88 < y < -4.29999999999999997e-95Initial program 97.8%
Taylor expanded in z around inf 62.2%
Taylor expanded in x around 0 48.5%
neg-mul-148.5%
Simplified48.5%
if -4.29999999999999997e-95 < y < 7.50000000000000007e-24Initial program 93.2%
associate-*l/94.2%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 67.1%
Final simplification61.6%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e+173) (* t (/ (- y x) y)) (if (<= y 5.1e+126) (* (- x y) (/ t (- z y))) (/ t (- 1.0 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+173) {
tmp = t * ((y - x) / y);
} else if (y <= 5.1e+126) {
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 <= (-5.5d+173)) then
tmp = t * ((y - x) / y)
else if (y <= 5.1d+126) 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 <= -5.5e+173) {
tmp = t * ((y - x) / y);
} else if (y <= 5.1e+126) {
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 <= -5.5e+173: tmp = t * ((y - x) / y) elif y <= 5.1e+126: 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 <= -5.5e+173) tmp = Float64(t * Float64(Float64(y - x) / y)); elseif (y <= 5.1e+126) 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 <= -5.5e+173) tmp = t * ((y - x) / y); elseif (y <= 5.1e+126) 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, -5.5e+173], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+126], 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 -5.5 \cdot 10^{+173}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+126}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if y < -5.50000000000000049e173Initial program 99.9%
Taylor expanded in z around 0 91.5%
associate-*r/91.5%
neg-mul-191.5%
neg-sub091.5%
sub-neg91.5%
+-commutative91.5%
associate--r+91.5%
neg-sub091.5%
remove-double-neg91.5%
Simplified91.5%
if -5.50000000000000049e173 < y < 5.1000000000000001e126Initial program 96.0%
associate-*l/92.1%
associate-/l*91.5%
Simplified91.5%
if 5.1000000000000001e126 < y Initial program 99.9%
associate-*l/68.6%
associate-/l*70.5%
Simplified70.5%
associate-*r/68.6%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 90.2%
mul-1-neg90.2%
div-sub90.2%
sub-neg90.2%
*-inverses90.2%
metadata-eval90.2%
Simplified90.2%
Taylor expanded in t around 0 90.2%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.6e+15) (not (<= x 5e-23))) (/ x (/ (- z y) t)) (/ t (- 1.0 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.6e+15) || !(x <= 5e-23)) {
tmp = x / ((z - y) / t);
} 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 ((x <= (-6.6d+15)) .or. (.not. (x <= 5d-23))) then
tmp = x / ((z - y) / t)
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 ((x <= -6.6e+15) || !(x <= 5e-23)) {
tmp = x / ((z - y) / t);
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.6e+15) or not (x <= 5e-23): tmp = x / ((z - y) / t) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.6e+15) || !(x <= 5e-23)) tmp = Float64(x / Float64(Float64(z - y) / t)); 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 ((x <= -6.6e+15) || ~((x <= 5e-23))) tmp = x / ((z - y) / t); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.6e+15], N[Not[LessEqual[x, 5e-23]], $MachinePrecision]], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+15} \lor \neg \left(x \leq 5 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{x}{\frac{z - y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if x < -6.6e15 or 5.0000000000000002e-23 < x Initial program 95.3%
associate-*l/81.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 69.3%
clear-num69.2%
un-div-inv69.8%
Applied egg-rr69.8%
if -6.6e15 < x < 5.0000000000000002e-23Initial program 98.4%
associate-*l/90.5%
associate-/l*85.2%
Simplified85.2%
associate-*r/90.5%
associate-*l/98.4%
*-commutative98.4%
clear-num98.3%
un-div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 85.9%
mul-1-neg85.9%
div-sub85.9%
sub-neg85.9%
*-inverses85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in t around 0 85.9%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6e+15) (not (<= x 3.9e-23))) (* x (/ t (- z y))) (/ t (- 1.0 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6e+15) || !(x <= 3.9e-23)) {
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 ((x <= (-6d+15)) .or. (.not. (x <= 3.9d-23))) 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 ((x <= -6e+15) || !(x <= 3.9e-23)) {
tmp = x * (t / (z - y));
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6e+15) or not (x <= 3.9e-23): tmp = x * (t / (z - y)) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6e+15) || !(x <= 3.9e-23)) tmp = Float64(x * 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 ((x <= -6e+15) || ~((x <= 3.9e-23))) tmp = x * (t / (z - y)); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6e+15], N[Not[LessEqual[x, 3.9e-23]], $MachinePrecision]], N[(x * 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}\;x \leq -6 \cdot 10^{+15} \lor \neg \left(x \leq 3.9 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if x < -6e15 or 3.9e-23 < x Initial program 95.3%
associate-*l/81.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 69.3%
if -6e15 < x < 3.9e-23Initial program 98.4%
associate-*l/90.5%
associate-/l*85.2%
Simplified85.2%
associate-*r/90.5%
associate-*l/98.4%
*-commutative98.4%
clear-num98.3%
un-div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 85.9%
mul-1-neg85.9%
div-sub85.9%
sub-neg85.9%
*-inverses85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in t around 0 85.9%
Final simplification77.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.2e+15) (not (<= x 4.5e-23))) (* x (/ t (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.2e+15) || !(x <= 4.5e-23)) {
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 <= (-3.2d+15)) .or. (.not. (x <= 4.5d-23))) 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 <= -3.2e+15) || !(x <= 4.5e-23)) {
tmp = x * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.2e+15) or not (x <= 4.5e-23): tmp = x * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.2e+15) || !(x <= 4.5e-23)) 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 <= -3.2e+15) || ~((x <= 4.5e-23))) 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, -3.2e+15], N[Not[LessEqual[x, 4.5e-23]], $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 -3.2 \cdot 10^{+15} \lor \neg \left(x \leq 4.5 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -3.2e15 or 4.49999999999999975e-23 < x Initial program 95.3%
associate-*l/81.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 69.3%
if -3.2e15 < x < 4.49999999999999975e-23Initial program 98.4%
Taylor expanded in x around 0 85.9%
neg-mul-185.9%
distribute-neg-frac285.9%
neg-sub085.9%
sub-neg85.9%
+-commutative85.9%
associate--r+85.9%
neg-sub085.9%
remove-double-neg85.9%
Simplified85.9%
Final simplification77.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.3e+15) (not (<= x 5.4e-23))) (* x (/ t (- z y))) (* y (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.3e+15) || !(x <= 5.4e-23)) {
tmp = x * (t / (z - y));
} else {
tmp = y * (t / (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 <= (-3.3d+15)) .or. (.not. (x <= 5.4d-23))) then
tmp = x * (t / (z - y))
else
tmp = y * (t / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.3e+15) || !(x <= 5.4e-23)) {
tmp = x * (t / (z - y));
} else {
tmp = y * (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.3e+15) or not (x <= 5.4e-23): tmp = x * (t / (z - y)) else: tmp = y * (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.3e+15) || !(x <= 5.4e-23)) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(y * Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.3e+15) || ~((x <= 5.4e-23))) tmp = x * (t / (z - y)); else tmp = y * (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.3e+15], N[Not[LessEqual[x, 5.4e-23]], $MachinePrecision]], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+15} \lor \neg \left(x \leq 5.4 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\end{array}
\end{array}
if x < -3.3e15 or 5.3999999999999997e-23 < x Initial program 95.3%
associate-*l/81.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 69.3%
if -3.3e15 < x < 5.3999999999999997e-23Initial program 98.4%
associate-*l/90.5%
associate-/l*85.2%
Simplified85.2%
Taylor expanded in x around 0 77.3%
associate-*r/77.3%
mul-1-neg77.3%
distribute-rgt-neg-out77.3%
associate-*l/73.5%
*-commutative73.5%
distribute-lft-neg-out73.5%
distribute-rgt-neg-in73.5%
distribute-frac-neg273.5%
neg-sub073.5%
sub-neg73.5%
+-commutative73.5%
associate--r+73.5%
neg-sub073.5%
remove-double-neg73.5%
Simplified73.5%
Final simplification71.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.6e+54) t (if (<= y 4.6e+43) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+54) {
tmp = t;
} else if (y <= 4.6e+43) {
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.6d+54)) then
tmp = t
else if (y <= 4.6d+43) 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.6e+54) {
tmp = t;
} else if (y <= 4.6e+43) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e+54: tmp = t elif y <= 4.6e+43: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e+54) tmp = t; elseif (y <= 4.6e+43) 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.6e+54) tmp = t; elseif (y <= 4.6e+43) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e+54], t, If[LessEqual[y, 4.6e+43], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+54}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.60000000000000007e54 or 4.6000000000000005e43 < y Initial program 99.9%
associate-*l/74.5%
associate-/l*77.7%
Simplified77.7%
Taylor expanded in y around inf 62.9%
if -2.60000000000000007e54 < y < 4.6000000000000005e43Initial program 94.7%
associate-*l/94.7%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in x around inf 69.6%
(FPCore (x y z t) :precision binary64 (if (<= y -9.2e+53) t (if (<= y 7.5e-24) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.2e+53) {
tmp = t;
} else if (y <= 7.5e-24) {
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.2d+53)) then
tmp = t
else if (y <= 7.5d-24) 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.2e+53) {
tmp = t;
} else if (y <= 7.5e-24) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.2e+53: tmp = t elif y <= 7.5e-24: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.2e+53) tmp = t; elseif (y <= 7.5e-24) 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.2e+53) tmp = t; elseif (y <= 7.5e-24) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.2e+53], t, If[LessEqual[y, 7.5e-24], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+53}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-24}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -9.20000000000000079e53 or 7.50000000000000007e-24 < y Initial program 99.9%
associate-*l/76.0%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in y around inf 60.9%
if -9.20000000000000079e53 < y < 7.50000000000000007e-24Initial program 94.4%
Taylor expanded in y around 0 58.5%
Final simplification59.6%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e+53) t (if (<= y 5e-42) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+53) {
tmp = t;
} else if (y <= 5e-42) {
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 <= (-7.5d+53)) then
tmp = t
else if (y <= 5d-42) 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 <= -7.5e+53) {
tmp = t;
} else if (y <= 5e-42) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e+53: tmp = t elif y <= 5e-42: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+53) tmp = t; elseif (y <= 5e-42) 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 <= -7.5e+53) tmp = t; elseif (y <= 5e-42) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+53], t, If[LessEqual[y, 5e-42], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+53}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-42}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.4999999999999997e53 or 5.00000000000000003e-42 < y Initial program 99.9%
associate-*l/76.8%
associate-/l*79.0%
Simplified79.0%
Taylor expanded in y around inf 59.9%
if -7.4999999999999997e53 < y < 5.00000000000000003e-42Initial program 94.3%
associate-*l/94.3%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in x around inf 71.4%
Taylor expanded in z around inf 57.8%
(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.9%
Final simplification96.9%
(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.9%
associate-*l/86.2%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in y around inf 33.5%
(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 2024157
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))