
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
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) / (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
def code(x, y, z, t): return x * ((y - z) / (t - z))
function code(x, y, z, t) return Float64(x * Float64(Float64(y - z) / Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x * ((y - z) / (t - z)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 85.9%
associate-/l*97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))))
(if (<= z -3.8e+47)
t_1
(if (<= z 4e-264)
(* (- y z) (/ x t))
(if (<= z 1.5e-10) (/ x (/ (- t z) y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -3.8e+47) {
tmp = t_1;
} else if (z <= 4e-264) {
tmp = (y - z) * (x / t);
} else if (z <= 1.5e-10) {
tmp = x / ((t - z) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z / (z - t))
if (z <= (-3.8d+47)) then
tmp = t_1
else if (z <= 4d-264) then
tmp = (y - z) * (x / t)
else if (z <= 1.5d-10) then
tmp = x / ((t - z) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -3.8e+47) {
tmp = t_1;
} else if (z <= 4e-264) {
tmp = (y - z) * (x / t);
} else if (z <= 1.5e-10) {
tmp = x / ((t - z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) tmp = 0 if z <= -3.8e+47: tmp = t_1 elif z <= 4e-264: tmp = (y - z) * (x / t) elif z <= 1.5e-10: tmp = x / ((t - z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -3.8e+47) tmp = t_1; elseif (z <= 4e-264) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 1.5e-10) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z / (z - t)); tmp = 0.0; if (z <= -3.8e+47) tmp = t_1; elseif (z <= 4e-264) tmp = (y - z) * (x / t); elseif (z <= 1.5e-10) tmp = x / ((t - z) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+47], t$95$1, If[LessEqual[z, 4e-264], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-10], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-264}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8000000000000003e47 or 1.5e-10 < z Initial program 77.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
distribute-neg-frac268.4%
neg-sub068.4%
associate--r-68.4%
neg-sub068.4%
+-commutative68.4%
sub-neg68.4%
associate-/l*87.6%
Simplified87.6%
if -3.8000000000000003e47 < z < 4e-264Initial program 95.1%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in t around inf 74.8%
*-commutative74.8%
associate-/l*75.7%
Applied egg-rr75.7%
if 4e-264 < z < 1.5e-10Initial program 94.3%
associate-/l*97.4%
Simplified97.4%
clear-num96.1%
un-div-inv96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 86.4%
Final simplification83.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))))
(if (<= z -3.8e+47)
t_1
(if (<= z -1.55e-207)
(* (- y z) (/ x t))
(if (<= z 1.9e-10) (/ (* x y) (- t z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -3.8e+47) {
tmp = t_1;
} else if (z <= -1.55e-207) {
tmp = (y - z) * (x / t);
} else if (z <= 1.9e-10) {
tmp = (x * y) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z / (z - t))
if (z <= (-3.8d+47)) then
tmp = t_1
else if (z <= (-1.55d-207)) then
tmp = (y - z) * (x / t)
else if (z <= 1.9d-10) then
tmp = (x * y) / (t - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -3.8e+47) {
tmp = t_1;
} else if (z <= -1.55e-207) {
tmp = (y - z) * (x / t);
} else if (z <= 1.9e-10) {
tmp = (x * y) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) tmp = 0 if z <= -3.8e+47: tmp = t_1 elif z <= -1.55e-207: tmp = (y - z) * (x / t) elif z <= 1.9e-10: tmp = (x * y) / (t - z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -3.8e+47) tmp = t_1; elseif (z <= -1.55e-207) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 1.9e-10) tmp = Float64(Float64(x * y) / Float64(t - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z / (z - t)); tmp = 0.0; if (z <= -3.8e+47) tmp = t_1; elseif (z <= -1.55e-207) tmp = (y - z) * (x / t); elseif (z <= 1.9e-10) tmp = (x * y) / (t - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+47], t$95$1, If[LessEqual[z, -1.55e-207], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-10], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-207}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-10}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8000000000000003e47 or 1.8999999999999999e-10 < z Initial program 77.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
distribute-neg-frac268.4%
neg-sub068.4%
associate--r-68.4%
neg-sub068.4%
+-commutative68.4%
sub-neg68.4%
associate-/l*87.6%
Simplified87.6%
if -3.8000000000000003e47 < z < -1.5500000000000001e-207Initial program 93.4%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in t around inf 71.8%
*-commutative71.8%
associate-/l*74.7%
Applied egg-rr74.7%
if -1.5500000000000001e-207 < z < 1.8999999999999999e-10Initial program 95.8%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in y around inf 86.3%
Final simplification84.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.2e-39) (not (<= z 1.6e-77))) (* x (- 1.0 (/ y z))) (* y (/ x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.2e-39) || !(z <= 1.6e-77)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y * (x / 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 ((z <= (-8.2d-39)) .or. (.not. (z <= 1.6d-77))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = y * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.2e-39) || !(z <= 1.6e-77)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y * (x / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8.2e-39) or not (z <= 1.6e-77): tmp = x * (1.0 - (y / z)) else: tmp = y * (x / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.2e-39) || !(z <= 1.6e-77)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(y * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8.2e-39) || ~((z <= 1.6e-77))) tmp = x * (1.0 - (y / z)); else tmp = y * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.2e-39], N[Not[LessEqual[z, 1.6e-77]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-39} \lor \neg \left(z \leq 1.6 \cdot 10^{-77}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\end{array}
\end{array}
if z < -8.2e-39 or 1.6e-77 < z Initial program 80.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 59.7%
mul-1-neg59.7%
associate-/l*76.4%
distribute-rgt-neg-in76.4%
distribute-frac-neg76.4%
neg-sub076.4%
associate--r-76.4%
neg-sub076.4%
+-commutative76.4%
sub-neg76.4%
div-sub76.4%
*-inverses76.4%
Simplified76.4%
if -8.2e-39 < z < 1.6e-77Initial program 94.3%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 67.3%
*-commutative67.3%
associate-/l*68.2%
Applied egg-rr68.2%
Final simplification73.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.1e-61) (not (<= z 1.4e-10))) (* x (/ z (- z t))) (/ (* x y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e-61) || !(z <= 1.4e-10)) {
tmp = x * (z / (z - t));
} else {
tmp = (x * y) / 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 ((z <= (-2.1d-61)) .or. (.not. (z <= 1.4d-10))) then
tmp = x * (z / (z - t))
else
tmp = (x * y) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e-61) || !(z <= 1.4e-10)) {
tmp = x * (z / (z - t));
} else {
tmp = (x * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.1e-61) or not (z <= 1.4e-10): tmp = x * (z / (z - t)) else: tmp = (x * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.1e-61) || !(z <= 1.4e-10)) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(Float64(x * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.1e-61) || ~((z <= 1.4e-10))) tmp = x * (z / (z - t)); else tmp = (x * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.1e-61], N[Not[LessEqual[z, 1.4e-10]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-61} \lor \neg \left(z \leq 1.4 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\end{array}
\end{array}
if z < -2.0999999999999999e-61 or 1.40000000000000008e-10 < z Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 67.5%
mul-1-neg67.5%
distribute-neg-frac267.5%
neg-sub067.5%
associate--r-67.5%
neg-sub067.5%
+-commutative67.5%
sub-neg67.5%
associate-/l*82.5%
Simplified82.5%
if -2.0999999999999999e-61 < z < 1.40000000000000008e-10Initial program 95.4%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 66.6%
Final simplification76.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.2e+47) (not (<= z 1.9e-10))) (* x (/ z (- z t))) (* (- y z) (/ x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e+47) || !(z <= 1.9e-10)) {
tmp = x * (z / (z - t));
} else {
tmp = (y - z) * (x / 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 ((z <= (-4.2d+47)) .or. (.not. (z <= 1.9d-10))) then
tmp = x * (z / (z - t))
else
tmp = (y - z) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e+47) || !(z <= 1.9e-10)) {
tmp = x * (z / (z - t));
} else {
tmp = (y - z) * (x / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.2e+47) or not (z <= 1.9e-10): tmp = x * (z / (z - t)) else: tmp = (y - z) * (x / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.2e+47) || !(z <= 1.9e-10)) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(Float64(y - z) * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.2e+47) || ~((z <= 1.9e-10))) tmp = x * (z / (z - t)); else tmp = (y - z) * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.2e+47], N[Not[LessEqual[z, 1.9e-10]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+47} \lor \neg \left(z \leq 1.9 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\end{array}
\end{array}
if z < -4.2e47 or 1.8999999999999999e-10 < z Initial program 77.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
distribute-neg-frac268.4%
neg-sub068.4%
associate--r-68.4%
neg-sub068.4%
+-commutative68.4%
sub-neg68.4%
associate-/l*87.6%
Simplified87.6%
if -4.2e47 < z < 1.8999999999999999e-10Initial program 94.7%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in t around inf 73.2%
*-commutative73.2%
associate-/l*73.0%
Applied egg-rr73.0%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= z -7.8e+52) x (if (<= z 7e-10) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e+52) {
tmp = x;
} else if (z <= 7e-10) {
tmp = x * (y / t);
} else {
tmp = x;
}
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 (z <= (-7.8d+52)) then
tmp = x
else if (z <= 7d-10) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e+52) {
tmp = x;
} else if (z <= 7e-10) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.8e+52: tmp = x elif z <= 7e-10: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.8e+52) tmp = x; elseif (z <= 7e-10) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.8e+52) tmp = x; elseif (z <= 7e-10) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.8e+52], x, If[LessEqual[z, 7e-10], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.7999999999999999e52 or 6.99999999999999961e-10 < z Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 72.9%
if -7.7999999999999999e52 < z < 6.99999999999999961e-10Initial program 94.8%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 61.5%
associate-/l*60.5%
Simplified60.5%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e+52) x (if (<= z 6.4e-10) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+52) {
tmp = x;
} else if (z <= 6.4e-10) {
tmp = y * (x / t);
} else {
tmp = x;
}
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 (z <= (-4.2d+52)) then
tmp = x
else if (z <= 6.4d-10) then
tmp = y * (x / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+52) {
tmp = x;
} else if (z <= 6.4e-10) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e+52: tmp = x elif z <= 6.4e-10: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e+52) tmp = x; elseif (z <= 6.4e-10) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e+52) tmp = x; elseif (z <= 6.4e-10) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e+52], x, If[LessEqual[z, 6.4e-10], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.2e52 or 6.39999999999999961e-10 < z Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 72.9%
if -4.2e52 < z < 6.39999999999999961e-10Initial program 94.8%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
associate-/l*61.4%
Applied egg-rr61.4%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e+51) x (if (<= z 2e-9) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e+51) {
tmp = x;
} else if (z <= 2e-9) {
tmp = (x * y) / t;
} else {
tmp = x;
}
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 (z <= (-1.8d+51)) then
tmp = x
else if (z <= 2d-9) then
tmp = (x * y) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e+51) {
tmp = x;
} else if (z <= 2e-9) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e+51: tmp = x elif z <= 2e-9: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e+51) tmp = x; elseif (z <= 2e-9) tmp = Float64(Float64(x * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e+51) tmp = x; elseif (z <= 2e-9) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e+51], x, If[LessEqual[z, 2e-9], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.80000000000000005e51 or 2.00000000000000012e-9 < z Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 72.9%
if -1.80000000000000005e51 < z < 2.00000000000000012e-9Initial program 94.8%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 61.5%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.9%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in z around inf 41.7%
Final simplification41.7%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024089
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))