
(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 (/ 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 97.9%
associate-*l/81.8%
associate-/l*82.5%
Simplified82.5%
associate-*r/81.8%
associate-*l/97.9%
*-commutative97.9%
clear-num97.9%
un-div-inv98.0%
Applied egg-rr98.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.6e+68) (not (<= y 2.85e+143))) (/ t (- 1.0 (/ z y))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+68) || !(y <= 2.85e+143)) {
tmp = t / (1.0 - (z / y));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-7.6d+68)) .or. (.not. (y <= 2.85d+143))) then
tmp = t / (1.0d0 - (z / y))
else
tmp = (x - y) * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+68) || !(y <= 2.85e+143)) {
tmp = t / (1.0 - (z / y));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.6e+68) or not (y <= 2.85e+143): tmp = t / (1.0 - (z / y)) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.6e+68) || !(y <= 2.85e+143)) tmp = Float64(t / Float64(1.0 - Float64(z / y))); else tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.6e+68) || ~((y <= 2.85e+143))) tmp = t / (1.0 - (z / y)); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.6e+68], N[Not[LessEqual[y, 2.85e+143]], $MachinePrecision]], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+68} \lor \neg \left(y \leq 2.85 \cdot 10^{+143}\right):\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -7.6000000000000002e68 or 2.85000000000000011e143 < y Initial program 99.9%
Taylor expanded in x around 0 91.3%
neg-mul-191.3%
distribute-neg-frac291.3%
neg-sub091.3%
sub-neg91.3%
+-commutative91.3%
associate--r+91.3%
neg-sub091.3%
remove-double-neg91.3%
Simplified91.3%
*-commutative91.3%
clear-num91.3%
un-div-inv91.3%
Applied egg-rr91.3%
div-sub91.3%
*-inverses91.3%
Simplified91.3%
if -7.6000000000000002e68 < y < 2.85000000000000011e143Initial program 96.8%
associate-*l/90.6%
associate-/l*93.9%
Simplified93.9%
Final simplification92.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.2e+67) (not (<= y 8e+24))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.2e+67) || !(y <= 8e+24)) {
tmp = t * (y / (y - z));
} 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 <= (-7.2d+67)) .or. (.not. (y <= 8d+24))) then
tmp = t * (y / (y - z))
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 <= -7.2e+67) || !(y <= 8e+24)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.2e+67) or not (y <= 8e+24): tmp = t * (y / (y - z)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.2e+67) || !(y <= 8e+24)) tmp = Float64(t * Float64(y / Float64(y - z))); 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 <= -7.2e+67) || ~((y <= 8e+24))) tmp = t * (y / (y - z)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.2e+67], N[Not[LessEqual[y, 8e+24]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+67} \lor \neg \left(y \leq 8 \cdot 10^{+24}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -7.1999999999999998e67 or 7.9999999999999999e24 < y Initial program 99.9%
Taylor expanded in x around 0 87.4%
neg-mul-187.4%
distribute-neg-frac287.4%
neg-sub087.4%
sub-neg87.4%
+-commutative87.4%
associate--r+87.4%
neg-sub087.4%
remove-double-neg87.4%
Simplified87.4%
if -7.1999999999999998e67 < y < 7.9999999999999999e24Initial program 96.4%
associate-*l/90.2%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in x around inf 78.6%
Final simplification82.4%
(FPCore (x y z t) :precision binary64 (if (<= y -8e+67) (/ t (- 1.0 (/ z y))) (if (<= y 2.5e-30) (/ x (/ (- z y) t)) (* t (/ (- y x) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8e+67) {
tmp = t / (1.0 - (z / y));
} else if (y <= 2.5e-30) {
tmp = x / ((z - y) / t);
} else {
tmp = t * ((y - x) / 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 <= (-8d+67)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 2.5d-30) then
tmp = x / ((z - y) / t)
else
tmp = t * ((y - x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8e+67) {
tmp = t / (1.0 - (z / y));
} else if (y <= 2.5e-30) {
tmp = x / ((z - y) / t);
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8e+67: tmp = t / (1.0 - (z / y)) elif y <= 2.5e-30: tmp = x / ((z - y) / t) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8e+67) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 2.5e-30) tmp = Float64(x / Float64(Float64(z - y) / t)); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8e+67) tmp = t / (1.0 - (z / y)); elseif (y <= 2.5e-30) tmp = x / ((z - y) / t); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8e+67], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-30], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+67}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\frac{z - y}{t}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -7.99999999999999986e67Initial program 99.9%
Taylor expanded in x around 0 88.6%
neg-mul-188.6%
distribute-neg-frac288.6%
neg-sub088.6%
sub-neg88.6%
+-commutative88.6%
associate--r+88.6%
neg-sub088.6%
remove-double-neg88.6%
Simplified88.6%
*-commutative88.6%
clear-num88.5%
un-div-inv88.6%
Applied egg-rr88.6%
div-sub88.6%
*-inverses88.6%
Simplified88.6%
if -7.99999999999999986e67 < y < 2.49999999999999986e-30Initial program 96.2%
associate-*l/90.1%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in x around inf 80.1%
clear-num79.9%
un-div-inv81.0%
Applied egg-rr81.0%
if 2.49999999999999986e-30 < y Initial program 99.8%
Taylor expanded in z around 0 82.8%
associate-*r/82.8%
neg-mul-182.8%
neg-sub082.8%
sub-neg82.8%
+-commutative82.8%
associate--r+82.8%
neg-sub082.8%
remove-double-neg82.8%
Simplified82.8%
Final simplification83.1%
(FPCore (x y z t) :precision binary64 (if (<= y -7.2e+67) (/ t (- 1.0 (/ z y))) (if (<= y 2e-29) (* x (/ t (- z y))) (* t (/ (- y x) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+67) {
tmp = t / (1.0 - (z / y));
} else if (y <= 2e-29) {
tmp = x * (t / (z - y));
} else {
tmp = t * ((y - x) / 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+67)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 2d-29) then
tmp = x * (t / (z - y))
else
tmp = t * ((y - x) / 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+67) {
tmp = t / (1.0 - (z / y));
} else if (y <= 2e-29) {
tmp = x * (t / (z - y));
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e+67: tmp = t / (1.0 - (z / y)) elif y <= 2e-29: tmp = x * (t / (z - y)) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e+67) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 2e-29) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.2e+67) tmp = t / (1.0 - (z / y)); elseif (y <= 2e-29) tmp = x * (t / (z - y)); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+67], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-29], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+67}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-29}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -7.1999999999999998e67Initial program 99.9%
Taylor expanded in x around 0 88.6%
neg-mul-188.6%
distribute-neg-frac288.6%
neg-sub088.6%
sub-neg88.6%
+-commutative88.6%
associate--r+88.6%
neg-sub088.6%
remove-double-neg88.6%
Simplified88.6%
*-commutative88.6%
clear-num88.5%
un-div-inv88.6%
Applied egg-rr88.6%
div-sub88.6%
*-inverses88.6%
Simplified88.6%
if -7.1999999999999998e67 < y < 1.99999999999999989e-29Initial program 96.2%
associate-*l/90.1%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in x around inf 80.1%
if 1.99999999999999989e-29 < y Initial program 99.8%
Taylor expanded in z around 0 82.8%
associate-*r/82.8%
neg-mul-182.8%
neg-sub082.8%
sub-neg82.8%
+-commutative82.8%
associate--r+82.8%
neg-sub082.8%
remove-double-neg82.8%
Simplified82.8%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= y -4.2e+68) (* t (/ y (- y z))) (if (<= y 3.15e-29) (* x (/ t (- z y))) (* t (/ (- y x) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+68) {
tmp = t * (y / (y - z));
} else if (y <= 3.15e-29) {
tmp = x * (t / (z - y));
} else {
tmp = t * ((y - x) / 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 <= (-4.2d+68)) then
tmp = t * (y / (y - z))
else if (y <= 3.15d-29) then
tmp = x * (t / (z - y))
else
tmp = t * ((y - x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+68) {
tmp = t * (y / (y - z));
} else if (y <= 3.15e-29) {
tmp = x * (t / (z - y));
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e+68: tmp = t * (y / (y - z)) elif y <= 3.15e-29: tmp = x * (t / (z - y)) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e+68) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 3.15e-29) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.2e+68) tmp = t * (y / (y - z)); elseif (y <= 3.15e-29) tmp = x * (t / (z - y)); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+68], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.15e-29], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+68}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{-29}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -4.20000000000000002e68Initial program 99.9%
Taylor expanded in x around 0 88.6%
neg-mul-188.6%
distribute-neg-frac288.6%
neg-sub088.6%
sub-neg88.6%
+-commutative88.6%
associate--r+88.6%
neg-sub088.6%
remove-double-neg88.6%
Simplified88.6%
if -4.20000000000000002e68 < y < 3.14999999999999998e-29Initial program 96.2%
associate-*l/90.1%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in x around inf 80.1%
if 3.14999999999999998e-29 < y Initial program 99.8%
Taylor expanded in z around 0 82.8%
associate-*r/82.8%
neg-mul-182.8%
neg-sub082.8%
sub-neg82.8%
+-commutative82.8%
associate--r+82.8%
neg-sub082.8%
remove-double-neg82.8%
Simplified82.8%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e+69) t (if (<= y 3.7e+24) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+69) {
tmp = t;
} else if (y <= 3.7e+24) {
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 <= (-3.1d+69)) then
tmp = t
else if (y <= 3.7d+24) 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 <= -3.1e+69) {
tmp = t;
} else if (y <= 3.7e+24) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e+69: tmp = t elif y <= 3.7e+24: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e+69) tmp = t; elseif (y <= 3.7e+24) 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 <= -3.1e+69) tmp = t; elseif (y <= 3.7e+24) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e+69], t, If[LessEqual[y, 3.7e+24], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+69}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.0999999999999998e69 or 3.69999999999999999e24 < y Initial program 99.9%
associate-*l/70.8%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in y around inf 76.1%
if -3.0999999999999998e69 < y < 3.69999999999999999e24Initial program 96.5%
associate-*l/90.3%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around inf 78.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.32e-24) t (if (<= y 2.02e+24) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.32e-24) {
tmp = t;
} else if (y <= 2.02e+24) {
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 <= (-1.32d-24)) then
tmp = t
else if (y <= 2.02d+24) 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 <= -1.32e-24) {
tmp = t;
} else if (y <= 2.02e+24) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.32e-24: tmp = t elif y <= 2.02e+24: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.32e-24) tmp = t; elseif (y <= 2.02e+24) 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 <= -1.32e-24) tmp = t; elseif (y <= 2.02e+24) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.32e-24], t, If[LessEqual[y, 2.02e+24], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{-24}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.02 \cdot 10^{+24}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.3199999999999999e-24 or 2.0199999999999999e24 < y Initial program 99.9%
associate-*l/74.9%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around inf 67.8%
if -1.3199999999999999e-24 < y < 2.0199999999999999e24Initial program 95.8%
associate-*l/89.4%
associate-/l*94.4%
Simplified94.4%
associate-*r/89.4%
associate-*l/95.8%
*-commutative95.8%
clear-num95.8%
un-div-inv96.0%
Applied egg-rr96.0%
Taylor expanded in y around 0 70.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1.5e-24) t (if (<= y 2.45e+25) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e-24) {
tmp = t;
} else if (y <= 2.45e+25) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.5d-24)) then
tmp = t
else if (y <= 2.45d+25) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e-24) {
tmp = t;
} else if (y <= 2.45e+25) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.5e-24: tmp = t elif y <= 2.45e+25: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.5e-24) tmp = t; elseif (y <= 2.45e+25) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.5e-24) tmp = t; elseif (y <= 2.45e+25) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.5e-24], t, If[LessEqual[y, 2.45e+25], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-24}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+25}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.49999999999999998e-24 or 2.45e25 < y Initial program 99.9%
associate-*l/74.9%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around inf 67.8%
if -1.49999999999999998e-24 < y < 2.45e25Initial program 95.8%
Taylor expanded in y around 0 70.4%
Final simplification69.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.46e-24) t (if (<= y 1.36e+25) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.46e-24) {
tmp = t;
} else if (y <= 1.36e+25) {
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.46d-24)) then
tmp = t
else if (y <= 1.36d+25) 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.46e-24) {
tmp = t;
} else if (y <= 1.36e+25) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.46e-24: tmp = t elif y <= 1.36e+25: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.46e-24) tmp = t; elseif (y <= 1.36e+25) 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.46e-24) tmp = t; elseif (y <= 1.36e+25) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.46e-24], t, If[LessEqual[y, 1.36e+25], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.46 \cdot 10^{-24}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+25}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.46000000000000009e-24 or 1.36e25 < y Initial program 99.9%
associate-*l/74.9%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around inf 67.8%
if -1.46000000000000009e-24 < y < 1.36e25Initial program 95.8%
associate-*l/89.4%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around inf 82.6%
Taylor expanded in z around inf 67.9%
(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 97.9%
Final simplification97.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 97.9%
associate-*l/81.8%
associate-/l*82.5%
Simplified82.5%
Taylor expanded in y around inf 38.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 2024184
(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))