
(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 13 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 82.5%
associate-/l*97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.5e+38)
x
(if (<= z 1.3e-25)
(/ x (/ t y))
(if (<= z 2.5e+16) x (if (<= z 1.08e+175) (* (/ x t) (- z)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+38) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else if (z <= 2.5e+16) {
tmp = x;
} else if (z <= 1.08e+175) {
tmp = (x / t) * -z;
} 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 <= (-8.5d+38)) then
tmp = x
else if (z <= 1.3d-25) then
tmp = x / (t / y)
else if (z <= 2.5d+16) then
tmp = x
else if (z <= 1.08d+175) then
tmp = (x / t) * -z
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 <= -8.5e+38) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else if (z <= 2.5e+16) {
tmp = x;
} else if (z <= 1.08e+175) {
tmp = (x / t) * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.5e+38: tmp = x elif z <= 1.3e-25: tmp = x / (t / y) elif z <= 2.5e+16: tmp = x elif z <= 1.08e+175: tmp = (x / t) * -z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e+38) tmp = x; elseif (z <= 1.3e-25) tmp = Float64(x / Float64(t / y)); elseif (z <= 2.5e+16) tmp = x; elseif (z <= 1.08e+175) tmp = Float64(Float64(x / t) * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.5e+38) tmp = x; elseif (z <= 1.3e-25) tmp = x / (t / y); elseif (z <= 2.5e+16) tmp = x; elseif (z <= 1.08e+175) tmp = (x / t) * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e+38], x, If[LessEqual[z, 1.3e-25], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+16], x, If[LessEqual[z, 1.08e+175], N[(N[(x / t), $MachinePrecision] * (-z)), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+175}:\\
\;\;\;\;\frac{x}{t} \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.4999999999999997e38 or 1.3e-25 < z < 2.5e16 or 1.08e175 < z Initial program 68.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 66.1%
if -8.4999999999999997e38 < z < 1.3e-25Initial program 95.9%
associate-/l*94.3%
Simplified94.3%
clear-num94.3%
un-div-inv94.4%
Applied egg-rr94.4%
Taylor expanded in z around 0 67.5%
if 2.5e16 < z < 1.08e175Initial program 75.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
remove-double-neg75.5%
distribute-neg-frac275.5%
*-commutative75.5%
associate-/l*85.9%
distribute-lft-neg-out85.9%
neg-sub085.9%
associate--r-85.9%
neg-sub085.9%
+-commutative85.9%
sub-neg85.9%
neg-sub085.9%
associate--r-85.9%
neg-sub085.9%
+-commutative85.9%
sub-neg85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in z around 0 48.1%
associate-*r/48.1%
neg-mul-148.1%
Simplified48.1%
Taylor expanded in z around inf 35.7%
mul-1-neg35.7%
associate-*l/42.1%
*-commutative42.1%
Simplified42.1%
Final simplification63.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.8e+38)
x
(if (<= z 1.3e-25)
(/ x (/ t y))
(if (<= z 2.3e+16) x (if (<= z 1.08e+175) (* x (/ z (- t))) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+38) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else if (z <= 2.3e+16) {
tmp = x;
} else if (z <= 1.08e+175) {
tmp = x * (z / -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 <= (-2.8d+38)) then
tmp = x
else if (z <= 1.3d-25) then
tmp = x / (t / y)
else if (z <= 2.3d+16) then
tmp = x
else if (z <= 1.08d+175) then
tmp = x * (z / -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 <= -2.8e+38) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else if (z <= 2.3e+16) {
tmp = x;
} else if (z <= 1.08e+175) {
tmp = x * (z / -t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e+38: tmp = x elif z <= 1.3e-25: tmp = x / (t / y) elif z <= 2.3e+16: tmp = x elif z <= 1.08e+175: tmp = x * (z / -t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e+38) tmp = x; elseif (z <= 1.3e-25) tmp = Float64(x / Float64(t / y)); elseif (z <= 2.3e+16) tmp = x; elseif (z <= 1.08e+175) tmp = Float64(x * Float64(z / Float64(-t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e+38) tmp = x; elseif (z <= 1.3e-25) tmp = x / (t / y); elseif (z <= 2.3e+16) tmp = x; elseif (z <= 1.08e+175) tmp = x * (z / -t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e+38], x, If[LessEqual[z, 1.3e-25], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+16], x, If[LessEqual[z, 1.08e+175], N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+175}:\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.8e38 or 1.3e-25 < z < 2.3e16 or 1.08e175 < z Initial program 68.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 66.1%
if -2.8e38 < z < 1.3e-25Initial program 95.9%
associate-/l*94.3%
Simplified94.3%
clear-num94.3%
un-div-inv94.4%
Applied egg-rr94.4%
Taylor expanded in z around 0 67.5%
if 2.3e16 < z < 1.08e175Initial program 75.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around inf 43.4%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in y around 0 35.7%
mul-1-neg35.7%
associate-/l*45.0%
distribute-rgt-neg-in45.0%
distribute-neg-frac245.0%
Simplified45.0%
Final simplification64.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.9e+39)
x
(if (<= z 1.3e-25)
(/ x (/ t y))
(if (<= z 8e+15) x (if (<= z 1.08e+175) (/ x (/ t (- z))) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.9e+39) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else if (z <= 8e+15) {
tmp = x;
} else if (z <= 1.08e+175) {
tmp = x / (t / -z);
} 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 <= (-3.9d+39)) then
tmp = x
else if (z <= 1.3d-25) then
tmp = x / (t / y)
else if (z <= 8d+15) then
tmp = x
else if (z <= 1.08d+175) then
tmp = x / (t / -z)
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 <= -3.9e+39) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else if (z <= 8e+15) {
tmp = x;
} else if (z <= 1.08e+175) {
tmp = x / (t / -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.9e+39: tmp = x elif z <= 1.3e-25: tmp = x / (t / y) elif z <= 8e+15: tmp = x elif z <= 1.08e+175: tmp = x / (t / -z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.9e+39) tmp = x; elseif (z <= 1.3e-25) tmp = Float64(x / Float64(t / y)); elseif (z <= 8e+15) tmp = x; elseif (z <= 1.08e+175) tmp = Float64(x / Float64(t / Float64(-z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.9e+39) tmp = x; elseif (z <= 1.3e-25) tmp = x / (t / y); elseif (z <= 8e+15) tmp = x; elseif (z <= 1.08e+175) tmp = x / (t / -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.9e+39], x, If[LessEqual[z, 1.3e-25], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+15], x, If[LessEqual[z, 1.08e+175], N[(x / N[(t / (-z)), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+175}:\\
\;\;\;\;\frac{x}{\frac{t}{-z}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.9000000000000001e39 or 1.3e-25 < z < 8e15 or 1.08e175 < z Initial program 68.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 66.1%
if -3.9000000000000001e39 < z < 1.3e-25Initial program 95.9%
associate-/l*94.3%
Simplified94.3%
clear-num94.3%
un-div-inv94.4%
Applied egg-rr94.4%
Taylor expanded in z around 0 67.5%
if 8e15 < z < 1.08e175Initial program 75.5%
associate-/l*99.6%
Simplified99.6%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
clear-num99.4%
inv-pow99.4%
Applied egg-rr99.4%
unpow-199.4%
Simplified99.4%
Taylor expanded in y around 0 66.0%
associate-*r/66.0%
neg-mul-166.0%
Simplified66.0%
Taylor expanded in t around inf 45.1%
associate-*r/45.1%
neg-mul-145.1%
Simplified45.1%
Final simplification64.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.5e-85) (not (<= z 1.2e-25))) (* x (- 1.0 (/ y z))) (/ x (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e-85) || !(z <= 1.2e-25)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / 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 ((z <= (-2.5d-85)) .or. (.not. (z <= 1.2d-25))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e-85) || !(z <= 1.2e-25)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.5e-85) or not (z <= 1.2e-25): tmp = x * (1.0 - (y / z)) else: tmp = x / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.5e-85) || !(z <= 1.2e-25)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.5e-85) || ~((z <= 1.2e-25))) tmp = x * (1.0 - (y / z)); else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.5e-85], N[Not[LessEqual[z, 1.2e-25]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-85} \lor \neg \left(z \leq 1.2 \cdot 10^{-25}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -2.5000000000000001e-85 or 1.20000000000000005e-25 < z Initial program 73.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 49.3%
mul-1-neg49.3%
associate-/l*70.7%
distribute-rgt-neg-in70.7%
distribute-frac-neg70.7%
neg-sub070.7%
associate--r-70.7%
neg-sub070.7%
+-commutative70.7%
sub-neg70.7%
div-sub70.7%
*-inverses70.7%
Simplified70.7%
if -2.5000000000000001e-85 < z < 1.20000000000000005e-25Initial program 95.4%
associate-/l*93.7%
Simplified93.7%
clear-num93.6%
un-div-inv93.7%
Applied egg-rr93.7%
Taylor expanded in z around 0 72.1%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8e+38) (not (<= z 1.3e-25))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+38) || !(z <= 1.3e-25)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - 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 ((z <= (-5.8d+38)) .or. (.not. (z <= 1.3d-25))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+38) || !(z <= 1.3e-25)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.8e+38) or not (z <= 1.3e-25): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.8e+38) || !(z <= 1.3e-25)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8e+38) || ~((z <= 1.3e-25))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8e+38], N[Not[LessEqual[z, 1.3e-25]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+38} \lor \neg \left(z \leq 1.3 \cdot 10^{-25}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -5.80000000000000013e38 or 1.3e-25 < z Initial program 70.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 49.9%
mul-1-neg49.9%
associate-/l*73.5%
distribute-rgt-neg-in73.5%
distribute-frac-neg73.5%
neg-sub073.5%
associate--r-73.5%
neg-sub073.5%
+-commutative73.5%
sub-neg73.5%
div-sub73.6%
*-inverses73.6%
Simplified73.6%
if -5.80000000000000013e38 < z < 1.3e-25Initial program 95.9%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in y around inf 81.1%
associate-/l*79.6%
Simplified79.6%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8e-74) (not (<= z 6.5e-69))) (* x (/ z (- z t))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e-74) || !(z <= 6.5e-69)) {
tmp = x * (z / (z - t));
} else {
tmp = x * (y / (t - 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 ((z <= (-5.8d-74)) .or. (.not. (z <= 6.5d-69))) then
tmp = x * (z / (z - t))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e-74) || !(z <= 6.5e-69)) {
tmp = x * (z / (z - t));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.8e-74) or not (z <= 6.5e-69): tmp = x * (z / (z - t)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.8e-74) || !(z <= 6.5e-69)) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8e-74) || ~((z <= 6.5e-69))) tmp = x * (z / (z - t)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8e-74], N[Not[LessEqual[z, 6.5e-69]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-74} \lor \neg \left(z \leq 6.5 \cdot 10^{-69}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -5.8e-74 or 6.49999999999999951e-69 < z Initial program 74.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 58.8%
mul-1-neg58.8%
distribute-neg-frac258.8%
neg-sub058.8%
associate--r-58.8%
neg-sub058.8%
+-commutative58.8%
sub-neg58.8%
associate-/l*77.1%
Simplified77.1%
if -5.8e-74 < z < 6.49999999999999951e-69Initial program 95.1%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in y around inf 86.7%
associate-/l*85.0%
Simplified85.0%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= z -9.6e-75) (* x (/ z (- z t))) (if (<= z 6.5e-69) (* x (/ y (- t z))) (/ x (- 1.0 (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.6e-75) {
tmp = x * (z / (z - t));
} else if (z <= 6.5e-69) {
tmp = x * (y / (t - z));
} else {
tmp = x / (1.0 - (t / 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 (z <= (-9.6d-75)) then
tmp = x * (z / (z - t))
else if (z <= 6.5d-69) then
tmp = x * (y / (t - z))
else
tmp = x / (1.0d0 - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.6e-75) {
tmp = x * (z / (z - t));
} else if (z <= 6.5e-69) {
tmp = x * (y / (t - z));
} else {
tmp = x / (1.0 - (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.6e-75: tmp = x * (z / (z - t)) elif z <= 6.5e-69: tmp = x * (y / (t - z)) else: tmp = x / (1.0 - (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.6e-75) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 6.5e-69) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x / Float64(1.0 - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -9.6e-75) tmp = x * (z / (z - t)); elseif (z <= 6.5e-69) tmp = x * (y / (t - z)); else tmp = x / (1.0 - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.6e-75], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-69], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-75}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-69}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -9.60000000000000077e-75Initial program 75.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
distribute-neg-frac260.9%
neg-sub060.9%
associate--r-60.9%
neg-sub060.9%
+-commutative60.9%
sub-neg60.9%
associate-/l*78.0%
Simplified78.0%
if -9.60000000000000077e-75 < z < 6.49999999999999951e-69Initial program 95.1%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in y around inf 86.7%
associate-/l*85.0%
Simplified85.0%
if 6.49999999999999951e-69 < z Initial program 73.2%
remove-double-neg73.2%
distribute-lft-neg-out73.2%
distribute-neg-frac73.2%
distribute-neg-frac273.2%
distribute-lft-neg-out73.2%
distribute-rgt-neg-in73.2%
sub-neg73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
+-commutative73.2%
sub-neg73.2%
sub-neg73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
+-commutative73.2%
sub-neg73.2%
Simplified73.2%
div-inv72.9%
*-commutative72.9%
associate-*l*81.9%
Applied egg-rr81.9%
Taylor expanded in y around 0 57.0%
associate-*l/60.4%
associate-/r/76.3%
div-sub76.3%
*-inverses76.3%
Simplified76.3%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= z -5.8e-74) (* x (/ z (- z t))) (if (<= z 3.9e-66) (/ x (/ (- t z) y)) (/ x (- 1.0 (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.8e-74) {
tmp = x * (z / (z - t));
} else if (z <= 3.9e-66) {
tmp = x / ((t - z) / y);
} else {
tmp = x / (1.0 - (t / 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 (z <= (-5.8d-74)) then
tmp = x * (z / (z - t))
else if (z <= 3.9d-66) then
tmp = x / ((t - z) / y)
else
tmp = x / (1.0d0 - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.8e-74) {
tmp = x * (z / (z - t));
} else if (z <= 3.9e-66) {
tmp = x / ((t - z) / y);
} else {
tmp = x / (1.0 - (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.8e-74: tmp = x * (z / (z - t)) elif z <= 3.9e-66: tmp = x / ((t - z) / y) else: tmp = x / (1.0 - (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.8e-74) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 3.9e-66) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x / Float64(1.0 - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.8e-74) tmp = x * (z / (z - t)); elseif (z <= 3.9e-66) tmp = x / ((t - z) / y); else tmp = x / (1.0 - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e-74], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-66], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-74}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -5.8e-74Initial program 75.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
distribute-neg-frac260.9%
neg-sub060.9%
associate--r-60.9%
neg-sub060.9%
+-commutative60.9%
sub-neg60.9%
associate-/l*78.0%
Simplified78.0%
if -5.8e-74 < z < 3.89999999999999983e-66Initial program 95.1%
associate-/l*93.4%
Simplified93.4%
clear-num93.3%
un-div-inv93.3%
Applied egg-rr93.3%
Taylor expanded in y around inf 85.0%
if 3.89999999999999983e-66 < z Initial program 73.2%
remove-double-neg73.2%
distribute-lft-neg-out73.2%
distribute-neg-frac73.2%
distribute-neg-frac273.2%
distribute-lft-neg-out73.2%
distribute-rgt-neg-in73.2%
sub-neg73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
+-commutative73.2%
sub-neg73.2%
sub-neg73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
+-commutative73.2%
sub-neg73.2%
Simplified73.2%
div-inv72.9%
*-commutative72.9%
associate-*l*81.9%
Applied egg-rr81.9%
Taylor expanded in y around 0 57.0%
associate-*l/60.4%
associate-/r/76.3%
div-sub76.3%
*-inverses76.3%
Simplified76.3%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= z -3.6e-74) (* x (/ z (- z t))) (if (<= z 5.1e-67) (/ (* x y) (- t z)) (/ x (- 1.0 (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e-74) {
tmp = x * (z / (z - t));
} else if (z <= 5.1e-67) {
tmp = (x * y) / (t - z);
} else {
tmp = x / (1.0 - (t / 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 (z <= (-3.6d-74)) then
tmp = x * (z / (z - t))
else if (z <= 5.1d-67) then
tmp = (x * y) / (t - z)
else
tmp = x / (1.0d0 - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e-74) {
tmp = x * (z / (z - t));
} else if (z <= 5.1e-67) {
tmp = (x * y) / (t - z);
} else {
tmp = x / (1.0 - (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e-74: tmp = x * (z / (z - t)) elif z <= 5.1e-67: tmp = (x * y) / (t - z) else: tmp = x / (1.0 - (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e-74) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 5.1e-67) tmp = Float64(Float64(x * y) / Float64(t - z)); else tmp = Float64(x / Float64(1.0 - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e-74) tmp = x * (z / (z - t)); elseif (z <= 5.1e-67) tmp = (x * y) / (t - z); else tmp = x / (1.0 - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e-74], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-67], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-74}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-67}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -3.6000000000000002e-74Initial program 75.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
distribute-neg-frac260.9%
neg-sub060.9%
associate--r-60.9%
neg-sub060.9%
+-commutative60.9%
sub-neg60.9%
associate-/l*78.0%
Simplified78.0%
if -3.6000000000000002e-74 < z < 5.09999999999999982e-67Initial program 95.1%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in y around inf 86.7%
if 5.09999999999999982e-67 < z Initial program 73.2%
remove-double-neg73.2%
distribute-lft-neg-out73.2%
distribute-neg-frac73.2%
distribute-neg-frac273.2%
distribute-lft-neg-out73.2%
distribute-rgt-neg-in73.2%
sub-neg73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
+-commutative73.2%
sub-neg73.2%
sub-neg73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
+-commutative73.2%
sub-neg73.2%
Simplified73.2%
div-inv72.9%
*-commutative72.9%
associate-*l*81.9%
Applied egg-rr81.9%
Taylor expanded in y around 0 57.0%
associate-*l/60.4%
associate-/r/76.3%
div-sub76.3%
*-inverses76.3%
Simplified76.3%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (if (<= z -5.3e+38) x (if (<= z 1.16e-25) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.3e+38) {
tmp = x;
} else if (z <= 1.16e-25) {
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 <= (-5.3d+38)) then
tmp = x
else if (z <= 1.16d-25) 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 <= -5.3e+38) {
tmp = x;
} else if (z <= 1.16e-25) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.3e+38: tmp = x elif z <= 1.16e-25: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.3e+38) tmp = x; elseif (z <= 1.16e-25) 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 <= -5.3e+38) tmp = x; elseif (z <= 1.16e-25) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.3e+38], x, If[LessEqual[z, 1.16e-25], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.30000000000000024e38 or 1.1599999999999999e-25 < z Initial program 70.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 57.0%
if -5.30000000000000024e38 < z < 1.1599999999999999e-25Initial program 95.9%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in z around 0 67.5%
associate-/l*67.5%
Simplified67.5%
Final simplification62.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.32e+39) x (if (<= z 1.3e-25) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.32e+39) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} 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.32d+39)) then
tmp = x
else if (z <= 1.3d-25) then
tmp = x / (t / y)
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.32e+39) {
tmp = x;
} else if (z <= 1.3e-25) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.32e+39: tmp = x elif z <= 1.3e-25: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.32e+39) tmp = x; elseif (z <= 1.3e-25) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.32e+39) tmp = x; elseif (z <= 1.3e-25) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.32e+39], x, If[LessEqual[z, 1.3e-25], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.32e39 or 1.3e-25 < z Initial program 70.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 57.0%
if -1.32e39 < z < 1.3e-25Initial program 95.9%
associate-/l*94.3%
Simplified94.3%
clear-num94.3%
un-div-inv94.4%
Applied egg-rr94.4%
Taylor expanded in z around 0 67.5%
Final simplification62.0%
(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 82.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 34.2%
Final simplification34.2%
(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 2024078
(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)))