
(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 (/ (- 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}
Initial program 80.4%
associate-/l*97.9%
Simplified97.9%
clear-num97.8%
un-div-inv98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -1.06e-9)
t_1
(if (<= z -1.95e-73)
(- (/ (* x z) t))
(if (<= z -3.4e-89)
(* x (/ y t))
(if (<= z -5.8e-136)
(/ (* x (- y)) z)
(if (<= z 6.9e-54) (/ x (/ t y)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.06e-9) {
tmp = t_1;
} else if (z <= -1.95e-73) {
tmp = -((x * z) / t);
} else if (z <= -3.4e-89) {
tmp = x * (y / t);
} else if (z <= -5.8e-136) {
tmp = (x * -y) / z;
} else if (z <= 6.9e-54) {
tmp = x / (t / 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 * (1.0d0 - (y / z))
if (z <= (-1.06d-9)) then
tmp = t_1
else if (z <= (-1.95d-73)) then
tmp = -((x * z) / t)
else if (z <= (-3.4d-89)) then
tmp = x * (y / t)
else if (z <= (-5.8d-136)) then
tmp = (x * -y) / z
else if (z <= 6.9d-54) then
tmp = x / (t / 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 * (1.0 - (y / z));
double tmp;
if (z <= -1.06e-9) {
tmp = t_1;
} else if (z <= -1.95e-73) {
tmp = -((x * z) / t);
} else if (z <= -3.4e-89) {
tmp = x * (y / t);
} else if (z <= -5.8e-136) {
tmp = (x * -y) / z;
} else if (z <= 6.9e-54) {
tmp = x / (t / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -1.06e-9: tmp = t_1 elif z <= -1.95e-73: tmp = -((x * z) / t) elif z <= -3.4e-89: tmp = x * (y / t) elif z <= -5.8e-136: tmp = (x * -y) / z elif z <= 6.9e-54: tmp = x / (t / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.06e-9) tmp = t_1; elseif (z <= -1.95e-73) tmp = Float64(-Float64(Float64(x * z) / t)); elseif (z <= -3.4e-89) tmp = Float64(x * Float64(y / t)); elseif (z <= -5.8e-136) tmp = Float64(Float64(x * Float64(-y)) / z); elseif (z <= 6.9e-54) tmp = Float64(x / Float64(t / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.06e-9) tmp = t_1; elseif (z <= -1.95e-73) tmp = -((x * z) / t); elseif (z <= -3.4e-89) tmp = x * (y / t); elseif (z <= -5.8e-136) tmp = (x * -y) / z; elseif (z <= 6.9e-54) tmp = x / (t / y); else tmp = t_1; 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, -1.06e-9], t$95$1, If[LessEqual[z, -1.95e-73], (-N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision]), If[LessEqual[z, -3.4e-89], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-136], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 6.9e-54], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.06 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-73}:\\
\;\;\;\;-\frac{x \cdot z}{t}\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-89}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-136}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\
\mathbf{elif}\;z \leq 6.9 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0600000000000001e-9 or 6.89999999999999969e-54 < z Initial program 72.3%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around 0 54.1%
mul-1-neg54.1%
associate-/l*73.2%
distribute-rgt-neg-in73.2%
distribute-frac-neg73.2%
neg-sub073.2%
associate--r-73.2%
neg-sub073.2%
+-commutative73.2%
sub-neg73.2%
div-sub73.2%
*-inverses73.2%
Simplified73.2%
if -1.0600000000000001e-9 < z < -1.94999999999999991e-73Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 75.5%
associate-*r/75.5%
mul-1-neg75.5%
distribute-rgt-neg-out75.5%
associate-*l/75.3%
*-commutative75.3%
distribute-lft-neg-out75.3%
distribute-rgt-neg-in75.3%
Simplified75.3%
Taylor expanded in z around 0 72.3%
associate-*r/72.3%
mul-1-neg72.3%
distribute-lft-neg-out72.3%
*-commutative72.3%
Simplified72.3%
if -1.94999999999999991e-73 < z < -3.4e-89Initial program 61.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around 0 41.9%
associate-/l*79.8%
Simplified79.8%
if -3.4e-89 < z < -5.79999999999999989e-136Initial program 99.7%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in t around 0 56.6%
mul-1-neg56.6%
associate-/l*5.3%
distribute-rgt-neg-in5.3%
distribute-frac-neg5.3%
neg-sub05.3%
associate--r-5.3%
neg-sub05.3%
+-commutative5.3%
sub-neg5.3%
div-sub5.3%
*-inverses5.3%
Simplified5.3%
Taylor expanded in y around inf 75.7%
associate-*r/75.7%
mul-1-neg75.7%
distribute-rgt-neg-out75.7%
Simplified75.7%
if -5.79999999999999989e-136 < z < 6.89999999999999969e-54Initial program 91.1%
associate-/l*97.7%
Simplified97.7%
clear-num97.5%
un-div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 78.8%
Final simplification75.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -7.5e+39)
(and (not (<= z -1.35e+14))
(or (<= z -2.5e-11) (not (<= z 1.66e+25)))))
(* x (- 1.0 (/ y z)))
(* x (/ (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e+39) || (!(z <= -1.35e+14) && ((z <= -2.5e-11) || !(z <= 1.66e+25)))) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * ((y - z) / 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 <= (-7.5d+39)) .or. (.not. (z <= (-1.35d+14))) .and. (z <= (-2.5d-11)) .or. (.not. (z <= 1.66d+25))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * ((y - z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e+39) || (!(z <= -1.35e+14) && ((z <= -2.5e-11) || !(z <= 1.66e+25)))) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.5e+39) or (not (z <= -1.35e+14) and ((z <= -2.5e-11) or not (z <= 1.66e+25))): tmp = x * (1.0 - (y / z)) else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.5e+39) || (!(z <= -1.35e+14) && ((z <= -2.5e-11) || !(z <= 1.66e+25)))) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(Float64(y - z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.5e+39) || (~((z <= -1.35e+14)) && ((z <= -2.5e-11) || ~((z <= 1.66e+25))))) tmp = x * (1.0 - (y / z)); else tmp = x * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.5e+39], And[N[Not[LessEqual[z, -1.35e+14]], $MachinePrecision], Or[LessEqual[z, -2.5e-11], N[Not[LessEqual[z, 1.66e+25]], $MachinePrecision]]]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+39} \lor \neg \left(z \leq -1.35 \cdot 10^{+14}\right) \land \left(z \leq -2.5 \cdot 10^{-11} \lor \neg \left(z \leq 1.66 \cdot 10^{+25}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if z < -7.5000000000000005e39 or -1.35e14 < z < -2.50000000000000009e-11 or 1.6600000000000001e25 < z Initial program 69.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 56.3%
mul-1-neg56.3%
associate-/l*79.8%
distribute-rgt-neg-in79.8%
distribute-frac-neg79.8%
neg-sub079.8%
associate--r-79.8%
neg-sub079.8%
+-commutative79.8%
sub-neg79.8%
div-sub79.8%
*-inverses79.8%
Simplified79.8%
if -7.5000000000000005e39 < z < -1.35e14 or -2.50000000000000009e-11 < z < 1.6600000000000001e25Initial program 90.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in t around inf 76.4%
associate-/l*84.4%
Simplified84.4%
Final simplification82.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y z) t))) (t_2 (* x (- 1.0 (/ y z)))))
(if (<= z -5.5e+39)
t_2
(if (<= z -9.5e+16)
t_1
(if (<= z -1.6e-9) t_2 (if (<= z 2.06e+18) t_1 (- x (* x (/ y z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x * (1.0 - (y / z));
double tmp;
if (z <= -5.5e+39) {
tmp = t_2;
} else if (z <= -9.5e+16) {
tmp = t_1;
} else if (z <= -1.6e-9) {
tmp = t_2;
} else if (z <= 2.06e+18) {
tmp = t_1;
} else {
tmp = x - (x * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y - z) / t)
t_2 = x * (1.0d0 - (y / z))
if (z <= (-5.5d+39)) then
tmp = t_2
else if (z <= (-9.5d+16)) then
tmp = t_1
else if (z <= (-1.6d-9)) then
tmp = t_2
else if (z <= 2.06d+18) then
tmp = t_1
else
tmp = x - (x * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x * (1.0 - (y / z));
double tmp;
if (z <= -5.5e+39) {
tmp = t_2;
} else if (z <= -9.5e+16) {
tmp = t_1;
} else if (z <= -1.6e-9) {
tmp = t_2;
} else if (z <= 2.06e+18) {
tmp = t_1;
} else {
tmp = x - (x * (y / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) t_2 = x * (1.0 - (y / z)) tmp = 0 if z <= -5.5e+39: tmp = t_2 elif z <= -9.5e+16: tmp = t_1 elif z <= -1.6e-9: tmp = t_2 elif z <= 2.06e+18: tmp = t_1 else: tmp = x - (x * (y / z)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) t_2 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -5.5e+39) tmp = t_2; elseif (z <= -9.5e+16) tmp = t_1; elseif (z <= -1.6e-9) tmp = t_2; elseif (z <= 2.06e+18) tmp = t_1; else tmp = Float64(x - Float64(x * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); t_2 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -5.5e+39) tmp = t_2; elseif (z <= -9.5e+16) tmp = t_1; elseif (z <= -1.6e-9) tmp = t_2; elseif (z <= 2.06e+18) tmp = t_1; else tmp = x - (x * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+39], t$95$2, If[LessEqual[z, -9.5e+16], t$95$1, If[LessEqual[z, -1.6e-9], t$95$2, If[LessEqual[z, 2.06e+18], t$95$1, N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.06 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -5.4999999999999997e39 or -9.5e16 < z < -1.60000000000000006e-9Initial program 77.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 62.5%
mul-1-neg62.5%
associate-/l*80.1%
distribute-rgt-neg-in80.1%
distribute-frac-neg80.1%
neg-sub080.1%
associate--r-80.1%
neg-sub080.1%
+-commutative80.1%
sub-neg80.1%
div-sub80.1%
*-inverses80.1%
Simplified80.1%
if -5.4999999999999997e39 < z < -9.5e16 or -1.60000000000000006e-9 < z < 2.06e18Initial program 90.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in t around inf 76.4%
associate-/l*84.4%
Simplified84.4%
if 2.06e18 < z Initial program 60.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.3%
associate--l+70.3%
distribute-lft-out--70.3%
div-sub70.3%
mul-1-neg70.3%
unsub-neg70.3%
*-commutative70.3%
distribute-lft-out--70.5%
Simplified70.5%
Taylor expanded in y around inf 74.3%
associate-/l*79.6%
Simplified79.6%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ t (- y z)))) (t_2 (* x (- 1.0 (/ y z)))))
(if (<= z -8.8e+39)
t_2
(if (<= z -45000000000000.0)
t_1
(if (<= z -5e-9) t_2 (if (<= z 2e+22) t_1 (- x (* x (/ y z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (t / (y - z));
double t_2 = x * (1.0 - (y / z));
double tmp;
if (z <= -8.8e+39) {
tmp = t_2;
} else if (z <= -45000000000000.0) {
tmp = t_1;
} else if (z <= -5e-9) {
tmp = t_2;
} else if (z <= 2e+22) {
tmp = t_1;
} else {
tmp = x - (x * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (t / (y - z))
t_2 = x * (1.0d0 - (y / z))
if (z <= (-8.8d+39)) then
tmp = t_2
else if (z <= (-45000000000000.0d0)) then
tmp = t_1
else if (z <= (-5d-9)) then
tmp = t_2
else if (z <= 2d+22) then
tmp = t_1
else
tmp = x - (x * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (t / (y - z));
double t_2 = x * (1.0 - (y / z));
double tmp;
if (z <= -8.8e+39) {
tmp = t_2;
} else if (z <= -45000000000000.0) {
tmp = t_1;
} else if (z <= -5e-9) {
tmp = t_2;
} else if (z <= 2e+22) {
tmp = t_1;
} else {
tmp = x - (x * (y / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (t / (y - z)) t_2 = x * (1.0 - (y / z)) tmp = 0 if z <= -8.8e+39: tmp = t_2 elif z <= -45000000000000.0: tmp = t_1 elif z <= -5e-9: tmp = t_2 elif z <= 2e+22: tmp = t_1 else: tmp = x - (x * (y / z)) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(t / Float64(y - z))) t_2 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -8.8e+39) tmp = t_2; elseif (z <= -45000000000000.0) tmp = t_1; elseif (z <= -5e-9) tmp = t_2; elseif (z <= 2e+22) tmp = t_1; else tmp = Float64(x - Float64(x * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (t / (y - z)); t_2 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -8.8e+39) tmp = t_2; elseif (z <= -45000000000000.0) tmp = t_1; elseif (z <= -5e-9) tmp = t_2; elseif (z <= 2e+22) tmp = t_1; else tmp = x - (x * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+39], t$95$2, If[LessEqual[z, -45000000000000.0], t$95$1, If[LessEqual[z, -5e-9], t$95$2, If[LessEqual[z, 2e+22], t$95$1, N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{t}{y - z}}\\
t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -45000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -8.8000000000000006e39 or -4.5e13 < z < -5.0000000000000001e-9Initial program 77.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 62.5%
mul-1-neg62.5%
associate-/l*80.1%
distribute-rgt-neg-in80.1%
distribute-frac-neg80.1%
neg-sub080.1%
associate--r-80.1%
neg-sub080.1%
+-commutative80.1%
sub-neg80.1%
div-sub80.1%
*-inverses80.1%
Simplified80.1%
if -8.8000000000000006e39 < z < -4.5e13 or -5.0000000000000001e-9 < z < 2e22Initial program 90.3%
associate-/l*96.3%
Simplified96.3%
clear-num96.1%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in t around inf 84.4%
if 2e22 < z Initial program 60.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.3%
associate--l+70.3%
distribute-lft-out--70.3%
div-sub70.3%
mul-1-neg70.3%
unsub-neg70.3%
*-commutative70.3%
distribute-lft-out--70.5%
Simplified70.5%
Taylor expanded in y around inf 74.3%
associate-/l*79.6%
Simplified79.6%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.7e+39)
x
(if (or (<= z -24000000000000.0)
(and (not (<= z -8.5e-10)) (<= z 1.95e+34)))
(* x (/ y t))
x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.7e+39) {
tmp = x;
} else if ((z <= -24000000000000.0) || (!(z <= -8.5e-10) && (z <= 1.95e+34))) {
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 <= (-4.7d+39)) then
tmp = x
else if ((z <= (-24000000000000.0d0)) .or. (.not. (z <= (-8.5d-10))) .and. (z <= 1.95d+34)) 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 <= -4.7e+39) {
tmp = x;
} else if ((z <= -24000000000000.0) || (!(z <= -8.5e-10) && (z <= 1.95e+34))) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.7e+39: tmp = x elif (z <= -24000000000000.0) or (not (z <= -8.5e-10) and (z <= 1.95e+34)): tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.7e+39) tmp = x; elseif ((z <= -24000000000000.0) || (!(z <= -8.5e-10) && (z <= 1.95e+34))) 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 <= -4.7e+39) tmp = x; elseif ((z <= -24000000000000.0) || (~((z <= -8.5e-10)) && (z <= 1.95e+34))) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.7e+39], x, If[Or[LessEqual[z, -24000000000000.0], And[N[Not[LessEqual[z, -8.5e-10]], $MachinePrecision], LessEqual[z, 1.95e+34]]], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -24000000000000 \lor \neg \left(z \leq -8.5 \cdot 10^{-10}\right) \land z \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.6999999999999999e39 or -2.4e13 < z < -8.4999999999999996e-10 or 1.9500000000000001e34 < z Initial program 68.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.8%
if -4.6999999999999999e39 < z < -2.4e13 or -8.4999999999999996e-10 < z < 1.9500000000000001e34Initial program 90.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around 0 64.3%
associate-/l*70.2%
Simplified70.2%
Final simplification65.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.8e+39)
x
(if (or (<= z -25000000000000.0) (and (not (<= z -1.22e-8)) (<= z 5.5e+35)))
(/ x (/ t y))
x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.8e+39) {
tmp = x;
} else if ((z <= -25000000000000.0) || (!(z <= -1.22e-8) && (z <= 5.5e+35))) {
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 <= (-8.8d+39)) then
tmp = x
else if ((z <= (-25000000000000.0d0)) .or. (.not. (z <= (-1.22d-8))) .and. (z <= 5.5d+35)) 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 <= -8.8e+39) {
tmp = x;
} else if ((z <= -25000000000000.0) || (!(z <= -1.22e-8) && (z <= 5.5e+35))) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.8e+39: tmp = x elif (z <= -25000000000000.0) or (not (z <= -1.22e-8) and (z <= 5.5e+35)): tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.8e+39) tmp = x; elseif ((z <= -25000000000000.0) || (!(z <= -1.22e-8) && (z <= 5.5e+35))) 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 <= -8.8e+39) tmp = x; elseif ((z <= -25000000000000.0) || (~((z <= -1.22e-8)) && (z <= 5.5e+35))) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.8e+39], x, If[Or[LessEqual[z, -25000000000000.0], And[N[Not[LessEqual[z, -1.22e-8]], $MachinePrecision], LessEqual[z, 5.5e+35]]], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -25000000000000 \lor \neg \left(z \leq -1.22 \cdot 10^{-8}\right) \land z \leq 5.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.8000000000000006e39 or -2.5e13 < z < -1.22e-8 or 5.50000000000000001e35 < z Initial program 68.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.8%
if -8.8000000000000006e39 < z < -2.5e13 or -1.22e-8 < z < 5.50000000000000001e35Initial program 90.5%
associate-/l*96.3%
Simplified96.3%
clear-num96.2%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 70.2%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (<= z -4.6e-73) (* x (/ z (- z t))) (if (<= z 6.5e-54) (/ x (/ t y)) (* x (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e-73) {
tmp = x * (z / (z - t));
} else if (z <= 6.5e-54) {
tmp = x / (t / y);
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-4.6d-73)) then
tmp = x * (z / (z - t))
else if (z <= 6.5d-54) then
tmp = x / (t / y)
else
tmp = x * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e-73) {
tmp = x * (z / (z - t));
} else if (z <= 6.5e-54) {
tmp = x / (t / y);
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.6e-73: tmp = x * (z / (z - t)) elif z <= 6.5e-54: tmp = x / (t / y) else: tmp = x * (1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e-73) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 6.5e-54) tmp = Float64(x / Float64(t / y)); else tmp = Float64(x * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.6e-73) tmp = x * (z / (z - t)); elseif (z <= 6.5e-54) tmp = x / (t / y); else tmp = x * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e-73], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-54], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -4.59999999999999977e-73Initial program 80.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 60.8%
mul-1-neg60.8%
distribute-neg-frac260.8%
neg-sub060.8%
associate--r-60.8%
neg-sub060.8%
+-commutative60.8%
sub-neg60.8%
associate-/l*73.2%
Simplified73.2%
if -4.59999999999999977e-73 < z < 6.49999999999999991e-54Initial program 90.1%
associate-/l*96.0%
Simplified96.0%
clear-num95.9%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in z around 0 78.0%
if 6.49999999999999991e-54 < z Initial program 66.6%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in t around 0 50.4%
mul-1-neg50.4%
associate-/l*72.5%
distribute-rgt-neg-in72.5%
distribute-frac-neg72.5%
neg-sub072.5%
associate--r-72.5%
neg-sub072.5%
+-commutative72.5%
sub-neg72.5%
div-sub72.5%
*-inverses72.5%
Simplified72.5%
Final simplification74.9%
(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.4%
associate-/l*97.9%
Simplified97.9%
Final simplification97.9%
(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.4%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in z around inf 33.1%
Final simplification33.1%
(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 2024073
(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)))