
(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 9 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 80.5%
associate-/l*96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -2.1e+77)
(and (not (<= z -6.3e-9)) (or (<= z -1.05e-60) (not (<= z 4.4e-11)))))
(* x (- 1.0 (/ y z)))
(* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e+77) || (!(z <= -6.3e-9) && ((z <= -1.05e-60) || !(z <= 4.4e-11)))) {
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 <= (-2.1d+77)) .or. (.not. (z <= (-6.3d-9))) .and. (z <= (-1.05d-60)) .or. (.not. (z <= 4.4d-11))) 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 <= -2.1e+77) || (!(z <= -6.3e-9) && ((z <= -1.05e-60) || !(z <= 4.4e-11)))) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.1e+77) or (not (z <= -6.3e-9) and ((z <= -1.05e-60) or not (z <= 4.4e-11))): 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 <= -2.1e+77) || (!(z <= -6.3e-9) && ((z <= -1.05e-60) || !(z <= 4.4e-11)))) 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 <= -2.1e+77) || (~((z <= -6.3e-9)) && ((z <= -1.05e-60) || ~((z <= 4.4e-11))))) 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, -2.1e+77], And[N[Not[LessEqual[z, -6.3e-9]], $MachinePrecision], Or[LessEqual[z, -1.05e-60], N[Not[LessEqual[z, 4.4e-11]], $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 -2.1 \cdot 10^{+77} \lor \neg \left(z \leq -6.3 \cdot 10^{-9}\right) \land \left(z \leq -1.05 \cdot 10^{-60} \lor \neg \left(z \leq 4.4 \cdot 10^{-11}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -2.0999999999999999e77 or -6.3000000000000002e-9 < z < -1.04999999999999996e-60 or 4.4000000000000003e-11 < z Initial program 67.0%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in t around 0 54.2%
mul-1-neg54.2%
associate-/l*81.5%
distribute-rgt-neg-in81.5%
distribute-frac-neg81.5%
neg-sub081.5%
associate--r-81.5%
neg-sub081.5%
+-commutative81.5%
sub-neg81.5%
div-sub81.5%
*-inverses81.5%
Simplified81.5%
if -2.0999999999999999e77 < z < -6.3000000000000002e-9 or -1.04999999999999996e-60 < z < 4.4000000000000003e-11Initial program 91.8%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in y around inf 75.1%
associate-/l*79.1%
Simplified79.1%
Final simplification80.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -1.7e+76)
(and (not (<= z -1e-9)) (or (<= z -1.1e-60) (not (<= z 4.8e-18)))))
(* x (- 1.0 (/ y z)))
(/ x (/ (- t z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e+76) || (!(z <= -1e-9) && ((z <= -1.1e-60) || !(z <= 4.8e-18)))) {
tmp = x * (1.0 - (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 ((z <= (-1.7d+76)) .or. (.not. (z <= (-1d-9))) .and. (z <= (-1.1d-60)) .or. (.not. (z <= 4.8d-18))) then
tmp = x * (1.0d0 - (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 ((z <= -1.7e+76) || (!(z <= -1e-9) && ((z <= -1.1e-60) || !(z <= 4.8e-18)))) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e+76) or (not (z <= -1e-9) and ((z <= -1.1e-60) or not (z <= 4.8e-18))): tmp = x * (1.0 - (y / z)) else: tmp = x / ((t - z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e+76) || (!(z <= -1e-9) && ((z <= -1.1e-60) || !(z <= 4.8e-18)))) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(Float64(t - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e+76) || (~((z <= -1e-9)) && ((z <= -1.1e-60) || ~((z <= 4.8e-18))))) tmp = x * (1.0 - (y / z)); else tmp = x / ((t - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e+76], And[N[Not[LessEqual[z, -1e-9]], $MachinePrecision], Or[LessEqual[z, -1.1e-60], N[Not[LessEqual[z, 4.8e-18]], $MachinePrecision]]]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+76} \lor \neg \left(z \leq -1 \cdot 10^{-9}\right) \land \left(z \leq -1.1 \cdot 10^{-60} \lor \neg \left(z \leq 4.8 \cdot 10^{-18}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if z < -1.6999999999999999e76 or -1.00000000000000006e-9 < z < -1.0999999999999999e-60 or 4.79999999999999988e-18 < z Initial program 67.0%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in t around 0 54.2%
mul-1-neg54.2%
associate-/l*81.5%
distribute-rgt-neg-in81.5%
distribute-frac-neg81.5%
neg-sub081.5%
associate--r-81.5%
neg-sub081.5%
+-commutative81.5%
sub-neg81.5%
div-sub81.5%
*-inverses81.5%
Simplified81.5%
if -1.6999999999999999e76 < z < -1.00000000000000006e-9 or -1.0999999999999999e-60 < z < 4.79999999999999988e-18Initial program 91.8%
associate-/l*94.3%
Simplified94.3%
clear-num93.6%
un-div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 79.4%
Final simplification80.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -5.2e+40)
t_1
(if (<= z -2.5e-8)
(* y (/ x t))
(if (or (<= z -1.26e-70) (not (<= z 3.4e-54))) t_1 (/ x (/ t y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -5.2e+40) {
tmp = t_1;
} else if (z <= -2.5e-8) {
tmp = y * (x / t);
} else if ((z <= -1.26e-70) || !(z <= 3.4e-54)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-5.2d+40)) then
tmp = t_1
else if (z <= (-2.5d-8)) then
tmp = y * (x / t)
else if ((z <= (-1.26d-70)) .or. (.not. (z <= 3.4d-54))) then
tmp = t_1
else
tmp = x / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -5.2e+40) {
tmp = t_1;
} else if (z <= -2.5e-8) {
tmp = y * (x / t);
} else if ((z <= -1.26e-70) || !(z <= 3.4e-54)) {
tmp = t_1;
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -5.2e+40: tmp = t_1 elif z <= -2.5e-8: tmp = y * (x / t) elif (z <= -1.26e-70) or not (z <= 3.4e-54): tmp = t_1 else: tmp = x / (t / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -5.2e+40) tmp = t_1; elseif (z <= -2.5e-8) tmp = Float64(y * Float64(x / t)); elseif ((z <= -1.26e-70) || !(z <= 3.4e-54)) tmp = t_1; else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -5.2e+40) tmp = t_1; elseif (z <= -2.5e-8) tmp = y * (x / t); elseif ((z <= -1.26e-70) || ~((z <= 3.4e-54))) tmp = t_1; else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+40], t$95$1, If[LessEqual[z, -2.5e-8], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.26e-70], N[Not[LessEqual[z, 3.4e-54]], $MachinePrecision]], t$95$1, N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-8}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-70} \lor \neg \left(z \leq 3.4 \cdot 10^{-54}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -5.2000000000000001e40 or -2.4999999999999999e-8 < z < -1.2600000000000001e-70 or 3.39999999999999987e-54 < z Initial program 71.3%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around 0 53.6%
mul-1-neg53.6%
associate-/l*76.7%
distribute-rgt-neg-in76.7%
distribute-frac-neg76.7%
neg-sub076.7%
associate--r-76.7%
neg-sub076.7%
+-commutative76.7%
sub-neg76.7%
div-sub76.7%
*-inverses76.7%
Simplified76.7%
if -5.2000000000000001e40 < z < -2.4999999999999999e-8Initial program 80.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around 0 41.7%
*-commutative41.7%
associate-/l*60.5%
Applied egg-rr60.5%
if -1.2600000000000001e-70 < z < 3.39999999999999987e-54Initial program 92.7%
associate-/l*92.3%
Simplified92.3%
clear-num91.5%
un-div-inv91.9%
Applied egg-rr91.9%
Taylor expanded in z around 0 71.8%
Final simplification73.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ (- t z) y))) (t_2 (* x (- 1.0 (/ y z)))))
(if (<= z -1.7e+76)
t_2
(if (<= z -8.5e-9)
t_1
(if (<= z -4e-70) (/ (* x (- z y)) z) (if (<= z 2.5e-16) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double t_2 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.7e+76) {
tmp = t_2;
} else if (z <= -8.5e-9) {
tmp = t_1;
} else if (z <= -4e-70) {
tmp = (x * (z - y)) / z;
} else if (z <= 2.5e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x / ((t - z) / y)
t_2 = x * (1.0d0 - (y / z))
if (z <= (-1.7d+76)) then
tmp = t_2
else if (z <= (-8.5d-9)) then
tmp = t_1
else if (z <= (-4d-70)) then
tmp = (x * (z - y)) / z
else if (z <= 2.5d-16) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double t_2 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.7e+76) {
tmp = t_2;
} else if (z <= -8.5e-9) {
tmp = t_1;
} else if (z <= -4e-70) {
tmp = (x * (z - y)) / z;
} else if (z <= 2.5e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((t - z) / y) t_2 = x * (1.0 - (y / z)) tmp = 0 if z <= -1.7e+76: tmp = t_2 elif z <= -8.5e-9: tmp = t_1 elif z <= -4e-70: tmp = (x * (z - y)) / z elif z <= 2.5e-16: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(t - z) / y)) t_2 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.7e+76) tmp = t_2; elseif (z <= -8.5e-9) tmp = t_1; elseif (z <= -4e-70) tmp = Float64(Float64(x * Float64(z - y)) / z); elseif (z <= 2.5e-16) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((t - z) / y); t_2 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.7e+76) tmp = t_2; elseif (z <= -8.5e-9) tmp = t_1; elseif (z <= -4e-70) tmp = (x * (z - y)) / z; elseif (z <= 2.5e-16) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+76], t$95$2, If[LessEqual[z, -8.5e-9], t$95$1, If[LessEqual[z, -4e-70], N[(N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.5e-16], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{t - z}{y}}\\
t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-70}:\\
\;\;\;\;\frac{x \cdot \left(z - y\right)}{z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.6999999999999999e76 or 2.5000000000000002e-16 < z Initial program 62.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 51.5%
mul-1-neg51.5%
associate-/l*83.3%
distribute-rgt-neg-in83.3%
distribute-frac-neg83.3%
neg-sub083.3%
associate--r-83.3%
neg-sub083.3%
+-commutative83.3%
sub-neg83.3%
div-sub83.3%
*-inverses83.3%
Simplified83.3%
if -1.6999999999999999e76 < z < -8.5e-9 or -3.99999999999999998e-70 < z < 2.5000000000000002e-16Initial program 91.7%
associate-/l*94.2%
Simplified94.2%
clear-num93.6%
un-div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 79.2%
if -8.5e-9 < z < -3.99999999999999998e-70Initial program 99.8%
remove-double-neg99.8%
distribute-lft-neg-out99.8%
distribute-neg-frac99.8%
distribute-neg-frac299.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 76.5%
Final simplification80.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ (- t z) y))) (t_2 (/ x (/ z (- z y)))))
(if (<= z -1.85e+78)
t_2
(if (<= z -6.8e-9)
t_1
(if (<= z -4.5e-70) (/ (* x (- z y)) z) (if (<= z 2.5e-12) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double t_2 = x / (z / (z - y));
double tmp;
if (z <= -1.85e+78) {
tmp = t_2;
} else if (z <= -6.8e-9) {
tmp = t_1;
} else if (z <= -4.5e-70) {
tmp = (x * (z - y)) / z;
} else if (z <= 2.5e-12) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x / ((t - z) / y)
t_2 = x / (z / (z - y))
if (z <= (-1.85d+78)) then
tmp = t_2
else if (z <= (-6.8d-9)) then
tmp = t_1
else if (z <= (-4.5d-70)) then
tmp = (x * (z - y)) / z
else if (z <= 2.5d-12) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double t_2 = x / (z / (z - y));
double tmp;
if (z <= -1.85e+78) {
tmp = t_2;
} else if (z <= -6.8e-9) {
tmp = t_1;
} else if (z <= -4.5e-70) {
tmp = (x * (z - y)) / z;
} else if (z <= 2.5e-12) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((t - z) / y) t_2 = x / (z / (z - y)) tmp = 0 if z <= -1.85e+78: tmp = t_2 elif z <= -6.8e-9: tmp = t_1 elif z <= -4.5e-70: tmp = (x * (z - y)) / z elif z <= 2.5e-12: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(t - z) / y)) t_2 = Float64(x / Float64(z / Float64(z - y))) tmp = 0.0 if (z <= -1.85e+78) tmp = t_2; elseif (z <= -6.8e-9) tmp = t_1; elseif (z <= -4.5e-70) tmp = Float64(Float64(x * Float64(z - y)) / z); elseif (z <= 2.5e-12) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((t - z) / y); t_2 = x / (z / (z - y)); tmp = 0.0; if (z <= -1.85e+78) tmp = t_2; elseif (z <= -6.8e-9) tmp = t_1; elseif (z <= -4.5e-70) tmp = (x * (z - y)) / z; elseif (z <= 2.5e-12) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+78], t$95$2, If[LessEqual[z, -6.8e-9], t$95$1, If[LessEqual[z, -4.5e-70], N[(N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.5e-12], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{t - z}{y}}\\
t_2 := \frac{x}{\frac{z}{z - y}}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+78}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-70}:\\
\;\;\;\;\frac{x \cdot \left(z - y\right)}{z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.84999999999999992e78 or 2.49999999999999985e-12 < z Initial program 62.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 83.4%
neg-mul-183.4%
distribute-neg-frac283.4%
neg-sub083.4%
associate--r-83.4%
neg-sub083.4%
Simplified83.4%
if -1.84999999999999992e78 < z < -6.7999999999999997e-9 or -4.50000000000000022e-70 < z < 2.49999999999999985e-12Initial program 91.7%
associate-/l*94.2%
Simplified94.2%
clear-num93.6%
un-div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 79.2%
if -6.7999999999999997e-9 < z < -4.50000000000000022e-70Initial program 99.8%
remove-double-neg99.8%
distribute-lft-neg-out99.8%
distribute-neg-frac99.8%
distribute-neg-frac299.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 76.5%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e+80) x (if (<= z 1.66e-18) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e+80) {
tmp = x;
} else if (z <= 1.66e-18) {
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 <= (-2.1d+80)) then
tmp = x
else if (z <= 1.66d-18) 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 <= -2.1e+80) {
tmp = x;
} else if (z <= 1.66e-18) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.1e+80: tmp = x elif z <= 1.66e-18: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.1e+80) tmp = x; elseif (z <= 1.66e-18) 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 <= -2.1e+80) tmp = x; elseif (z <= 1.66e-18) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e+80], x, If[LessEqual[z, 1.66e-18], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.10000000000000001e80 or 1.66e-18 < z Initial program 62.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 64.9%
if -2.10000000000000001e80 < z < 1.66e-18Initial program 92.5%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in z around 0 56.9%
associate-/l*60.9%
Simplified60.9%
Final simplification62.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.7e+76) x (if (<= z 1e-12) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+76) {
tmp = x;
} else if (z <= 1e-12) {
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.7d+76)) then
tmp = x
else if (z <= 1d-12) 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.7e+76) {
tmp = x;
} else if (z <= 1e-12) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e+76: tmp = x elif z <= 1e-12: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e+76) tmp = x; elseif (z <= 1e-12) 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.7e+76) tmp = x; elseif (z <= 1e-12) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e+76], x, If[LessEqual[z, 1e-12], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+76}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 10^{-12}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.6999999999999999e76 or 9.9999999999999998e-13 < z Initial program 62.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 64.9%
if -1.6999999999999999e76 < z < 9.9999999999999998e-13Initial program 92.5%
associate-/l*94.1%
Simplified94.1%
clear-num93.6%
un-div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 61.1%
Final simplification62.7%
(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 80.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 33.4%
Final simplification33.4%
(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 2024115
(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)))