
(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 11 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 84.0%
*-commutative84.0%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
associate-*r/84.0%
associate-/l*97.2%
Applied egg-rr97.2%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (+ (/ t z) -1.0))))
(if (<= z -2e+20)
t_1
(if (<= z 4.4e-11)
(* y (/ x (- t z)))
(if (or (<= z 6.8e+33) (not (<= z 6.2e+113)))
t_1
(/ (* x y) (- t z)))))))
double code(double x, double y, double z, double t) {
double t_1 = -x / ((t / z) + -1.0);
double tmp;
if (z <= -2e+20) {
tmp = t_1;
} else if (z <= 4.4e-11) {
tmp = y * (x / (t - z));
} else if ((z <= 6.8e+33) || !(z <= 6.2e+113)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = -x / ((t / z) + (-1.0d0))
if (z <= (-2d+20)) then
tmp = t_1
else if (z <= 4.4d-11) then
tmp = y * (x / (t - z))
else if ((z <= 6.8d+33) .or. (.not. (z <= 6.2d+113))) then
tmp = t_1
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 t_1 = -x / ((t / z) + -1.0);
double tmp;
if (z <= -2e+20) {
tmp = t_1;
} else if (z <= 4.4e-11) {
tmp = y * (x / (t - z));
} else if ((z <= 6.8e+33) || !(z <= 6.2e+113)) {
tmp = t_1;
} else {
tmp = (x * y) / (t - z);
}
return tmp;
}
def code(x, y, z, t): t_1 = -x / ((t / z) + -1.0) tmp = 0 if z <= -2e+20: tmp = t_1 elif z <= 4.4e-11: tmp = y * (x / (t - z)) elif (z <= 6.8e+33) or not (z <= 6.2e+113): tmp = t_1 else: tmp = (x * y) / (t - z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)) tmp = 0.0 if (z <= -2e+20) tmp = t_1; elseif (z <= 4.4e-11) tmp = Float64(y * Float64(x / Float64(t - z))); elseif ((z <= 6.8e+33) || !(z <= 6.2e+113)) tmp = t_1; else tmp = Float64(Float64(x * y) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -x / ((t / z) + -1.0); tmp = 0.0; if (z <= -2e+20) tmp = t_1; elseif (z <= 4.4e-11) tmp = y * (x / (t - z)); elseif ((z <= 6.8e+33) || ~((z <= 6.2e+113))) tmp = t_1; else tmp = (x * y) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+20], t$95$1, If[LessEqual[z, 4.4e-11], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.8e+33], N[Not[LessEqual[z, 6.2e+113]], $MachinePrecision]], t$95$1, N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{\frac{t}{z} + -1}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-11}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+33} \lor \neg \left(z \leq 6.2 \cdot 10^{+113}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\end{array}
\end{array}
if z < -2e20 or 4.4000000000000003e-11 < z < 6.7999999999999999e33 or 6.19999999999999982e113 < z Initial program 71.3%
*-commutative71.3%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 58.7%
mul-1-neg58.7%
associate-/l*83.8%
distribute-neg-frac83.8%
div-sub83.8%
*-inverses83.8%
Simplified83.8%
if -2e20 < z < 4.4000000000000003e-11Initial program 92.7%
*-commutative92.7%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around inf 76.0%
associate-*l/79.5%
*-commutative79.5%
Simplified79.5%
if 6.7999999999999999e33 < z < 6.19999999999999982e113Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 72.9%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (+ (/ t z) -1.0))))
(if (<= z -9.8e+27)
t_1
(if (<= z 1.06e-11)
(* y (/ x (- t z)))
(if (<= z 5.4e+36)
(/ (* x (- z)) (- t z))
(if (<= z 6.2e+113) (/ (* x y) (- t z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = -x / ((t / z) + -1.0);
double tmp;
if (z <= -9.8e+27) {
tmp = t_1;
} else if (z <= 1.06e-11) {
tmp = y * (x / (t - z));
} else if (z <= 5.4e+36) {
tmp = (x * -z) / (t - z);
} else if (z <= 6.2e+113) {
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 / ((t / z) + (-1.0d0))
if (z <= (-9.8d+27)) then
tmp = t_1
else if (z <= 1.06d-11) then
tmp = y * (x / (t - z))
else if (z <= 5.4d+36) then
tmp = (x * -z) / (t - z)
else if (z <= 6.2d+113) 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 / ((t / z) + -1.0);
double tmp;
if (z <= -9.8e+27) {
tmp = t_1;
} else if (z <= 1.06e-11) {
tmp = y * (x / (t - z));
} else if (z <= 5.4e+36) {
tmp = (x * -z) / (t - z);
} else if (z <= 6.2e+113) {
tmp = (x * y) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -x / ((t / z) + -1.0) tmp = 0 if z <= -9.8e+27: tmp = t_1 elif z <= 1.06e-11: tmp = y * (x / (t - z)) elif z <= 5.4e+36: tmp = (x * -z) / (t - z) elif z <= 6.2e+113: tmp = (x * y) / (t - z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)) tmp = 0.0 if (z <= -9.8e+27) tmp = t_1; elseif (z <= 1.06e-11) tmp = Float64(y * Float64(x / Float64(t - z))); elseif (z <= 5.4e+36) tmp = Float64(Float64(x * Float64(-z)) / Float64(t - z)); elseif (z <= 6.2e+113) 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 / ((t / z) + -1.0); tmp = 0.0; if (z <= -9.8e+27) tmp = t_1; elseif (z <= 1.06e-11) tmp = y * (x / (t - z)); elseif (z <= 5.4e+36) tmp = (x * -z) / (t - z); elseif (z <= 6.2e+113) 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[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.8e+27], t$95$1, If[LessEqual[z, 1.06e-11], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+36], N[(N[(x * (-z)), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+113], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{\frac{t}{z} + -1}\\
\mathbf{if}\;z \leq -9.8 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-11}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+36}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{t - z}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+113}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.8000000000000003e27 or 6.19999999999999982e113 < z Initial program 68.0%
*-commutative68.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 55.9%
mul-1-neg55.9%
associate-/l*83.8%
distribute-neg-frac83.8%
div-sub83.9%
*-inverses83.9%
Simplified83.9%
if -9.8000000000000003e27 < z < 1.05999999999999993e-11Initial program 92.7%
*-commutative92.7%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around inf 76.0%
associate-*l/79.5%
*-commutative79.5%
Simplified79.5%
if 1.05999999999999993e-11 < z < 5.4000000000000002e36Initial program 100.0%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
distribute-rgt-neg-out83.2%
Simplified83.2%
if 5.4000000000000002e36 < z < 6.19999999999999982e113Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 72.9%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.85e+29)
x
(if (<= z 2.85e-27)
(/ x (/ t y))
(if (<= z 6.2e+113) (* x (- (/ y z))) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+29) {
tmp = x;
} else if (z <= 2.85e-27) {
tmp = x / (t / y);
} else if (z <= 6.2e+113) {
tmp = x * -(y / 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 <= (-1.85d+29)) then
tmp = x
else if (z <= 2.85d-27) then
tmp = x / (t / y)
else if (z <= 6.2d+113) then
tmp = x * -(y / 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 <= -1.85e+29) {
tmp = x;
} else if (z <= 2.85e-27) {
tmp = x / (t / y);
} else if (z <= 6.2e+113) {
tmp = x * -(y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.85e+29: tmp = x elif z <= 2.85e-27: tmp = x / (t / y) elif z <= 6.2e+113: tmp = x * -(y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.85e+29) tmp = x; elseif (z <= 2.85e-27) tmp = Float64(x / Float64(t / y)); elseif (z <= 6.2e+113) tmp = Float64(x * Float64(-Float64(y / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.85e+29) tmp = x; elseif (z <= 2.85e-27) tmp = x / (t / y); elseif (z <= 6.2e+113) tmp = x * -(y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.85e+29], x, If[LessEqual[z, 2.85e-27], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+113], N[(x * (-N[(y / z), $MachinePrecision])), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-27}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+113}:\\
\;\;\;\;x \cdot \left(-\frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.84999999999999987e29 or 6.19999999999999982e113 < z Initial program 68.0%
*-commutative68.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 63.3%
if -1.84999999999999987e29 < z < 2.8499999999999998e-27Initial program 92.4%
*-commutative92.4%
associate-*l/93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in z around 0 59.3%
associate-/l*62.6%
Simplified62.6%
if 2.8499999999999998e-27 < z < 6.19999999999999982e113Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 64.1%
Taylor expanded in t around 0 49.2%
associate-*r/49.2%
neg-mul-149.2%
Simplified49.2%
Final simplification61.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e+19) (not (<= z 2e-10))) (* x (- 1.0 (/ y z))) (* y (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e+19) || !(z <= 2e-10)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y * (x / (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.5d+19)) .or. (.not. (z <= 2d-10))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = y * (x / (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.5e+19) || !(z <= 2e-10)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e+19) or not (z <= 2e-10): tmp = x * (1.0 - (y / z)) else: tmp = y * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e+19) || !(z <= 2e-10)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(y * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e+19) || ~((z <= 2e-10))) tmp = x * (1.0 - (y / z)); else tmp = y * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e+19], N[Not[LessEqual[z, 2e-10]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+19} \lor \neg \left(z \leq 2 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -9.5e19 or 2.00000000000000007e-10 < z Initial program 74.5%
*-commutative74.5%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
associate-*r/74.5%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 53.9%
associate-*r/53.9%
neg-mul-153.9%
neg-sub053.9%
distribute-lft-out--53.0%
associate--r-53.0%
neg-sub053.0%
mul-1-neg53.0%
+-commutative53.0%
mul-1-neg53.0%
sub-neg53.0%
distribute-lft-out--53.9%
associate-/l*74.7%
Simplified74.7%
clear-num74.4%
associate-/r/74.6%
clear-num74.7%
div-sub74.7%
*-inverses74.7%
Applied egg-rr74.7%
if -9.5e19 < z < 2.00000000000000007e-10Initial program 92.7%
*-commutative92.7%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around inf 76.0%
associate-*l/79.5%
*-commutative79.5%
Simplified79.5%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (<= z -3.7e+30) x (if (<= z 2e+114) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+30) {
tmp = x;
} else if (z <= 2e+114) {
tmp = x * (y / (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.7d+30)) then
tmp = x
else if (z <= 2d+114) then
tmp = x * (y / (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.7e+30) {
tmp = x;
} else if (z <= 2e+114) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.7e+30: tmp = x elif z <= 2e+114: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+30) tmp = x; elseif (z <= 2e+114) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.7e+30) tmp = x; elseif (z <= 2e+114) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+30], x, If[LessEqual[z, 2e+114], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+114}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.70000000000000016e30 or 2e114 < z Initial program 68.0%
*-commutative68.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 63.3%
if -3.70000000000000016e30 < z < 2e114Initial program 93.8%
*-commutative93.8%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in y around inf 75.3%
Final simplification70.7%
(FPCore (x y z t) :precision binary64 (if (<= z -4.5e+22) (* x (- 1.0 (/ y z))) (if (<= z 3.2e-12) (* y (/ x (- t z))) (/ x (/ z (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e+22) {
tmp = x * (1.0 - (y / z));
} else if (z <= 3.2e-12) {
tmp = y * (x / (t - z));
} else {
tmp = x / (z / (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 <= (-4.5d+22)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 3.2d-12) then
tmp = y * (x / (t - z))
else
tmp = x / (z / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e+22) {
tmp = x * (1.0 - (y / z));
} else if (z <= 3.2e-12) {
tmp = y * (x / (t - z));
} else {
tmp = x / (z / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5e+22: tmp = x * (1.0 - (y / z)) elif z <= 3.2e-12: tmp = y * (x / (t - z)) else: tmp = x / (z / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5e+22) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 3.2e-12) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = Float64(x / Float64(z / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5e+22) tmp = x * (1.0 - (y / z)); elseif (z <= 3.2e-12) tmp = y * (x / (t - z)); else tmp = x / (z / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e+22], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-12], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-12}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{z - y}}\\
\end{array}
\end{array}
if z < -4.4999999999999998e22Initial program 69.3%
*-commutative69.3%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
associate-*r/69.3%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 50.9%
associate-*r/50.9%
neg-mul-150.9%
neg-sub050.9%
distribute-lft-out--49.3%
associate--r-49.3%
neg-sub049.3%
mul-1-neg49.3%
+-commutative49.3%
mul-1-neg49.3%
sub-neg49.3%
distribute-lft-out--50.9%
associate-/l*75.5%
Simplified75.5%
clear-num75.3%
associate-/r/75.5%
clear-num75.5%
div-sub75.5%
*-inverses75.5%
Applied egg-rr75.5%
if -4.4999999999999998e22 < z < 3.2000000000000001e-12Initial program 92.7%
*-commutative92.7%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around inf 76.0%
associate-*l/79.5%
*-commutative79.5%
Simplified79.5%
if 3.2000000000000001e-12 < z Initial program 79.8%
*-commutative79.8%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
associate-*r/79.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 56.9%
associate-*r/56.9%
neg-mul-156.9%
neg-sub056.9%
distribute-lft-out--56.8%
associate--r-56.8%
neg-sub056.8%
mul-1-neg56.8%
+-commutative56.8%
mul-1-neg56.8%
sub-neg56.8%
distribute-lft-out--56.9%
associate-/l*73.9%
Simplified73.9%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (<= z -4.45e+21) x (if (<= z 2.6e-11) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.45e+21) {
tmp = x;
} else if (z <= 2.6e-11) {
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.45d+21)) then
tmp = x
else if (z <= 2.6d-11) 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.45e+21) {
tmp = x;
} else if (z <= 2.6e-11) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.45e+21: tmp = x elif z <= 2.6e-11: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.45e+21) tmp = x; elseif (z <= 2.6e-11) 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.45e+21) tmp = x; elseif (z <= 2.6e-11) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.45e+21], x, If[LessEqual[z, 2.6e-11], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.45 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.45e21 or 2.6000000000000001e-11 < z Initial program 74.5%
*-commutative74.5%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 56.8%
if -4.45e21 < z < 2.6000000000000001e-11Initial program 92.7%
*-commutative92.7%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 61.4%
Final simplification59.2%
(FPCore (x y z t) :precision binary64 (if (<= z -8.7e+27) x (if (<= z 1.8e-12) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.7e+27) {
tmp = x;
} else if (z <= 1.8e-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 <= (-8.7d+27)) then
tmp = x
else if (z <= 1.8d-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 <= -8.7e+27) {
tmp = x;
} else if (z <= 1.8e-12) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.7e+27: tmp = x elif z <= 1.8e-12: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.7e+27) tmp = x; elseif (z <= 1.8e-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 <= -8.7e+27) tmp = x; elseif (z <= 1.8e-12) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.7e+27], x, If[LessEqual[z, 1.8e-12], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.7 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.7000000000000004e27 or 1.8e-12 < z Initial program 74.5%
*-commutative74.5%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 56.8%
if -8.7000000000000004e27 < z < 1.8e-12Initial program 92.7%
*-commutative92.7%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 58.6%
associate-/l*61.8%
Simplified61.8%
Final simplification59.4%
(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 84.0%
*-commutative84.0%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Final simplification96.8%
(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 84.0%
*-commutative84.0%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in z around inf 32.8%
Final simplification32.8%
(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 2023322
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))