
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((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 * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((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 * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y z) (* z t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+157)))
(* 2.0 (/ (/ x z) (- y t)))
(/ (* 2.0 x) (* z (- y t))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+157)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * x) / (z * (y - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+157)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * x) / (z * (y - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - (z * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+157): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (2.0 * x) / (z * (y - t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - Float64(z * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+157)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(2.0 * x) / Float64(z * Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) - (z * t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+157))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (2.0 * x) / (z * (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+157]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+157}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -inf.0 or 4.99999999999999976e157 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 80.4%
*-commutative80.4%
associate-*r/80.4%
distribute-rgt-out--81.7%
associate-/r*99.9%
Simplified99.9%
if -inf.0 < (-.f64 (*.f64 y z) (*.f64 t z)) < 4.99999999999999976e157Initial program 98.0%
distribute-rgt-out--99.2%
Simplified99.2%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))) (t_2 (* (/ x t) (/ -2.0 z))))
(if (<= t -1.7e+31)
t_2
(if (<= t -180000.0)
t_1
(if (<= t -5e-62)
t_2
(if (<= t 2900000.0) t_1 (* x (/ -2.0 (* z t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double t_2 = (x / t) * (-2.0 / z);
double tmp;
if (t <= -1.7e+31) {
tmp = t_2;
} else if (t <= -180000.0) {
tmp = t_1;
} else if (t <= -5e-62) {
tmp = t_2;
} else if (t <= 2900000.0) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (2.0d0 / z) * (x / y)
t_2 = (x / t) * ((-2.0d0) / z)
if (t <= (-1.7d+31)) then
tmp = t_2
else if (t <= (-180000.0d0)) then
tmp = t_1
else if (t <= (-5d-62)) then
tmp = t_2
else if (t <= 2900000.0d0) then
tmp = t_1
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double t_2 = (x / t) * (-2.0 / z);
double tmp;
if (t <= -1.7e+31) {
tmp = t_2;
} else if (t <= -180000.0) {
tmp = t_1;
} else if (t <= -5e-62) {
tmp = t_2;
} else if (t <= 2900000.0) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) t_2 = (x / t) * (-2.0 / z) tmp = 0 if t <= -1.7e+31: tmp = t_2 elif t <= -180000.0: tmp = t_1 elif t <= -5e-62: tmp = t_2 elif t <= 2900000.0: tmp = t_1 else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / z) * Float64(x / y)) t_2 = Float64(Float64(x / t) * Float64(-2.0 / z)) tmp = 0.0 if (t <= -1.7e+31) tmp = t_2; elseif (t <= -180000.0) tmp = t_1; elseif (t <= -5e-62) tmp = t_2; elseif (t <= 2900000.0) tmp = t_1; else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / z) * (x / y); t_2 = (x / t) * (-2.0 / z); tmp = 0.0; if (t <= -1.7e+31) tmp = t_2; elseif (t <= -180000.0) tmp = t_1; elseif (t <= -5e-62) tmp = t_2; elseif (t <= 2900000.0) tmp = t_1; else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+31], t$95$2, If[LessEqual[t, -180000.0], t$95$1, If[LessEqual[t, -5e-62], t$95$2, If[LessEqual[t, 2900000.0], t$95$1, N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
t_2 := \frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+31}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -180000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2900000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.6999999999999999e31 or -1.8e5 < t < -5.0000000000000002e-62Initial program 90.5%
*-commutative90.5%
associate-*r/90.5%
distribute-rgt-out--90.5%
associate-/r*89.1%
Simplified89.1%
Taylor expanded in y around 0 75.0%
associate-*r/75.0%
*-commutative75.0%
*-commutative75.0%
Simplified75.0%
*-commutative75.0%
times-frac82.8%
Applied egg-rr82.8%
if -1.6999999999999999e31 < t < -1.8e5 or -5.0000000000000002e-62 < t < 2.9e6Initial program 94.2%
*-commutative94.2%
distribute-rgt-out--96.7%
times-frac97.2%
Simplified97.2%
Taylor expanded in y around inf 81.9%
if 2.9e6 < t Initial program 92.5%
*-commutative92.5%
associate-*r/92.5%
distribute-rgt-out--92.4%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in x around 0 92.4%
associate-*r/92.5%
*-commutative92.5%
times-frac94.8%
associate-*l/89.2%
associate-*r/93.9%
Simplified93.9%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
Simplified81.6%
Final simplification82.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= t -1.62e+31)
(* (/ (/ x t) z) -2.0)
(if (<= t -90000.0)
t_1
(if (<= t -6.6e-63)
(* (/ x t) (/ -2.0 z))
(if (<= t 200.0) t_1 (* x (/ -2.0 (* z t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.62e+31) {
tmp = ((x / t) / z) * -2.0;
} else if (t <= -90000.0) {
tmp = t_1;
} else if (t <= -6.6e-63) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 200.0) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / z) * (x / y)
if (t <= (-1.62d+31)) then
tmp = ((x / t) / z) * (-2.0d0)
else if (t <= (-90000.0d0)) then
tmp = t_1
else if (t <= (-6.6d-63)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 200.0d0) then
tmp = t_1
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.62e+31) {
tmp = ((x / t) / z) * -2.0;
} else if (t <= -90000.0) {
tmp = t_1;
} else if (t <= -6.6e-63) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 200.0) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) tmp = 0 if t <= -1.62e+31: tmp = ((x / t) / z) * -2.0 elif t <= -90000.0: tmp = t_1 elif t <= -6.6e-63: tmp = (x / t) * (-2.0 / z) elif t <= 200.0: tmp = t_1 else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / z) * Float64(x / y)) tmp = 0.0 if (t <= -1.62e+31) tmp = Float64(Float64(Float64(x / t) / z) * -2.0); elseif (t <= -90000.0) tmp = t_1; elseif (t <= -6.6e-63) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 200.0) tmp = t_1; else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / z) * (x / y); tmp = 0.0; if (t <= -1.62e+31) tmp = ((x / t) / z) * -2.0; elseif (t <= -90000.0) tmp = t_1; elseif (t <= -6.6e-63) tmp = (x / t) * (-2.0 / z); elseif (t <= 200.0) tmp = t_1; else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.62e+31], N[(N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, -90000.0], t$95$1, If[LessEqual[t, -6.6e-63], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 200.0], t$95$1, N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\
\mathbf{elif}\;t \leq -90000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.6 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 200:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.6199999999999999e31Initial program 89.6%
*-commutative89.6%
associate-*r/89.5%
distribute-rgt-out--89.5%
associate-/r*87.6%
Simplified87.6%
Taylor expanded in y around 0 75.9%
*-commutative75.9%
associate-/r*86.1%
Simplified86.1%
if -1.6199999999999999e31 < t < -9e4 or -6.59999999999999987e-63 < t < 200Initial program 94.2%
*-commutative94.2%
distribute-rgt-out--96.7%
times-frac97.2%
Simplified97.2%
Taylor expanded in y around inf 81.9%
if -9e4 < t < -6.59999999999999987e-63Initial program 93.9%
*-commutative93.9%
associate-*r/93.9%
distribute-rgt-out--94.0%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in y around 0 71.5%
associate-*r/71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
*-commutative71.5%
times-frac71.6%
Applied egg-rr71.6%
if 200 < t Initial program 92.5%
*-commutative92.5%
associate-*r/92.5%
distribute-rgt-out--92.4%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in x around 0 92.4%
associate-*r/92.5%
*-commutative92.5%
times-frac94.8%
associate-*l/89.2%
associate-*r/93.9%
Simplified93.9%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
Simplified81.6%
Final simplification82.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= t -1.86e+31)
(* (/ (/ x t) z) -2.0)
(if (<= t -180000.0)
t_1
(if (<= t -4.5e-62)
(* (/ x t) (/ -2.0 z))
(if (<= t 11000.0) t_1 (/ (* x -2.0) (* z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.86e+31) {
tmp = ((x / t) / z) * -2.0;
} else if (t <= -180000.0) {
tmp = t_1;
} else if (t <= -4.5e-62) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 11000.0) {
tmp = t_1;
} else {
tmp = (x * -2.0) / (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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / z) * (x / y)
if (t <= (-1.86d+31)) then
tmp = ((x / t) / z) * (-2.0d0)
else if (t <= (-180000.0d0)) then
tmp = t_1
else if (t <= (-4.5d-62)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 11000.0d0) then
tmp = t_1
else
tmp = (x * (-2.0d0)) / (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.86e+31) {
tmp = ((x / t) / z) * -2.0;
} else if (t <= -180000.0) {
tmp = t_1;
} else if (t <= -4.5e-62) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 11000.0) {
tmp = t_1;
} else {
tmp = (x * -2.0) / (z * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) tmp = 0 if t <= -1.86e+31: tmp = ((x / t) / z) * -2.0 elif t <= -180000.0: tmp = t_1 elif t <= -4.5e-62: tmp = (x / t) * (-2.0 / z) elif t <= 11000.0: tmp = t_1 else: tmp = (x * -2.0) / (z * t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / z) * Float64(x / y)) tmp = 0.0 if (t <= -1.86e+31) tmp = Float64(Float64(Float64(x / t) / z) * -2.0); elseif (t <= -180000.0) tmp = t_1; elseif (t <= -4.5e-62) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 11000.0) tmp = t_1; else tmp = Float64(Float64(x * -2.0) / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / z) * (x / y); tmp = 0.0; if (t <= -1.86e+31) tmp = ((x / t) / z) * -2.0; elseif (t <= -180000.0) tmp = t_1; elseif (t <= -4.5e-62) tmp = (x / t) * (-2.0 / z); elseif (t <= 11000.0) tmp = t_1; else tmp = (x * -2.0) / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.86e+31], N[(N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, -180000.0], t$95$1, If[LessEqual[t, -4.5e-62], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 11000.0], t$95$1, N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.86 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\
\mathbf{elif}\;t \leq -180000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 11000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot -2}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.86000000000000008e31Initial program 89.6%
*-commutative89.6%
associate-*r/89.5%
distribute-rgt-out--89.5%
associate-/r*87.6%
Simplified87.6%
Taylor expanded in y around 0 75.9%
*-commutative75.9%
associate-/r*86.1%
Simplified86.1%
if -1.86000000000000008e31 < t < -1.8e5 or -4.50000000000000018e-62 < t < 11000Initial program 94.2%
*-commutative94.2%
distribute-rgt-out--96.7%
times-frac97.2%
Simplified97.2%
Taylor expanded in y around inf 81.9%
if -1.8e5 < t < -4.50000000000000018e-62Initial program 93.9%
*-commutative93.9%
associate-*r/93.9%
distribute-rgt-out--94.0%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in y around 0 71.5%
associate-*r/71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
*-commutative71.5%
times-frac71.6%
Applied egg-rr71.6%
if 11000 < t Initial program 92.5%
*-commutative92.5%
associate-*r/92.5%
distribute-rgt-out--92.4%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in y around 0 81.6%
associate-*r/81.6%
*-commutative81.6%
*-commutative81.6%
Simplified81.6%
Final simplification82.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= t -1.62e+31)
(* (/ (/ x t) z) -2.0)
(if (<= t -92000.0)
t_1
(if (<= t -9e-64)
(/ (* (/ x z) -2.0) t)
(if (<= t 1960.0) t_1 (/ (* x -2.0) (* z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.62e+31) {
tmp = ((x / t) / z) * -2.0;
} else if (t <= -92000.0) {
tmp = t_1;
} else if (t <= -9e-64) {
tmp = ((x / z) * -2.0) / t;
} else if (t <= 1960.0) {
tmp = t_1;
} else {
tmp = (x * -2.0) / (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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / z) * (x / y)
if (t <= (-1.62d+31)) then
tmp = ((x / t) / z) * (-2.0d0)
else if (t <= (-92000.0d0)) then
tmp = t_1
else if (t <= (-9d-64)) then
tmp = ((x / z) * (-2.0d0)) / t
else if (t <= 1960.0d0) then
tmp = t_1
else
tmp = (x * (-2.0d0)) / (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.62e+31) {
tmp = ((x / t) / z) * -2.0;
} else if (t <= -92000.0) {
tmp = t_1;
} else if (t <= -9e-64) {
tmp = ((x / z) * -2.0) / t;
} else if (t <= 1960.0) {
tmp = t_1;
} else {
tmp = (x * -2.0) / (z * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) tmp = 0 if t <= -1.62e+31: tmp = ((x / t) / z) * -2.0 elif t <= -92000.0: tmp = t_1 elif t <= -9e-64: tmp = ((x / z) * -2.0) / t elif t <= 1960.0: tmp = t_1 else: tmp = (x * -2.0) / (z * t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / z) * Float64(x / y)) tmp = 0.0 if (t <= -1.62e+31) tmp = Float64(Float64(Float64(x / t) / z) * -2.0); elseif (t <= -92000.0) tmp = t_1; elseif (t <= -9e-64) tmp = Float64(Float64(Float64(x / z) * -2.0) / t); elseif (t <= 1960.0) tmp = t_1; else tmp = Float64(Float64(x * -2.0) / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / z) * (x / y); tmp = 0.0; if (t <= -1.62e+31) tmp = ((x / t) / z) * -2.0; elseif (t <= -92000.0) tmp = t_1; elseif (t <= -9e-64) tmp = ((x / z) * -2.0) / t; elseif (t <= 1960.0) tmp = t_1; else tmp = (x * -2.0) / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.62e+31], N[(N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, -92000.0], t$95$1, If[LessEqual[t, -9e-64], N[(N[(N[(x / z), $MachinePrecision] * -2.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1960.0], t$95$1, N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\
\mathbf{elif}\;t \leq -92000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-64}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\
\mathbf{elif}\;t \leq 1960:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot -2}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.6199999999999999e31Initial program 89.6%
*-commutative89.6%
associate-*r/89.5%
distribute-rgt-out--89.5%
associate-/r*87.6%
Simplified87.6%
Taylor expanded in y around 0 75.9%
*-commutative75.9%
associate-/r*86.1%
Simplified86.1%
if -1.6199999999999999e31 < t < -92000 or -9.00000000000000019e-64 < t < 1960Initial program 94.2%
*-commutative94.2%
distribute-rgt-out--96.7%
times-frac97.2%
Simplified97.2%
Taylor expanded in y around inf 81.9%
if -92000 < t < -9.00000000000000019e-64Initial program 93.9%
*-commutative93.9%
associate-*r/93.9%
distribute-rgt-out--94.0%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in y around 0 71.5%
*-commutative71.5%
associate-/r*71.6%
Simplified71.6%
*-commutative71.6%
associate-/l/71.5%
associate-*r/71.5%
*-commutative71.5%
times-frac77.2%
associate-*r/77.3%
Applied egg-rr77.3%
if 1960 < t Initial program 92.5%
*-commutative92.5%
associate-*r/92.5%
distribute-rgt-out--92.4%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in y around 0 81.6%
associate-*r/81.6%
*-commutative81.6%
*-commutative81.6%
Simplified81.6%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e-27) (not (<= z 1.4e-47))) (* 2.0 (/ (/ x z) (- y t))) (* x (/ (/ 2.0 (- y t)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-27) || !(z <= 1.4e-47)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * ((2.0 / (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 <= (-9.5d-27)) .or. (.not. (z <= 1.4d-47))) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = x * ((2.0d0 / (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 <= -9.5e-27) || !(z <= 1.4e-47)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * ((2.0 / (y - t)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e-27) or not (z <= 1.4e-47): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = x * ((2.0 / (y - t)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e-27) || !(z <= 1.4e-47)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(x * Float64(Float64(2.0 / Float64(y - t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e-27) || ~((z <= 1.4e-47))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = x * ((2.0 / (y - t)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e-27], N[Not[LessEqual[z, 1.4e-47]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-27} \lor \neg \left(z \leq 1.4 \cdot 10^{-47}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\
\end{array}
\end{array}
if z < -9.50000000000000037e-27 or 1.39999999999999996e-47 < z Initial program 89.8%
*-commutative89.8%
associate-*r/89.8%
distribute-rgt-out--90.4%
associate-/r*99.0%
Simplified99.0%
if -9.50000000000000037e-27 < z < 1.39999999999999996e-47Initial program 96.8%
*-commutative96.8%
associate-*r/96.8%
distribute-rgt-out--98.7%
associate-/r*76.6%
Simplified76.6%
Taylor expanded in x around 0 98.7%
associate-*r/98.8%
*-commutative98.8%
times-frac76.5%
associate-*l/90.4%
associate-*r/98.7%
Simplified98.7%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.1e-23)
(* 2.0 (/ (/ x z) (- y t)))
(if (<= z 1.5e+35)
(* x (/ (/ 2.0 (- y t)) z))
(* (/ 2.0 z) (/ x (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-23) {
tmp = 2.0 * ((x / z) / (y - t));
} else if (z <= 1.5e+35) {
tmp = x * ((2.0 / (y - t)) / z);
} else {
tmp = (2.0 / z) * (x / (y - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.1d-23)) then
tmp = 2.0d0 * ((x / z) / (y - t))
else if (z <= 1.5d+35) then
tmp = x * ((2.0d0 / (y - t)) / z)
else
tmp = (2.0d0 / z) * (x / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-23) {
tmp = 2.0 * ((x / z) / (y - t));
} else if (z <= 1.5e+35) {
tmp = x * ((2.0 / (y - t)) / z);
} else {
tmp = (2.0 / z) * (x / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.1e-23: tmp = 2.0 * ((x / z) / (y - t)) elif z <= 1.5e+35: tmp = x * ((2.0 / (y - t)) / z) else: tmp = (2.0 / z) * (x / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e-23) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 1.5e+35) tmp = Float64(x * Float64(Float64(2.0 / Float64(y - t)) / z)); else tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.1e-23) tmp = 2.0 * ((x / z) / (y - t)); elseif (z <= 1.5e+35) tmp = x * ((2.0 / (y - t)) / z); else tmp = (2.0 / z) * (x / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e-23], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+35], N[(x * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-23}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if z < -1.1e-23Initial program 92.6%
*-commutative92.6%
associate-*r/92.6%
distribute-rgt-out--92.6%
associate-/r*98.6%
Simplified98.6%
if -1.1e-23 < z < 1.49999999999999995e35Initial program 97.3%
*-commutative97.3%
associate-*r/97.3%
distribute-rgt-out--98.9%
associate-/r*80.6%
Simplified80.6%
Taylor expanded in x around 0 98.9%
associate-*r/98.9%
*-commutative98.9%
times-frac80.5%
associate-*l/91.8%
associate-*r/98.9%
Simplified98.9%
if 1.49999999999999995e35 < z Initial program 81.1%
*-commutative81.1%
distribute-rgt-out--83.1%
times-frac99.7%
Simplified99.7%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.8e-63) (not (<= t 2300.0))) (* x (/ -2.0 (* z t))) (* x (/ (/ 2.0 y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.8e-63) || !(t <= 2300.0)) {
tmp = x * (-2.0 / (z * t));
} else {
tmp = x * ((2.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 ((t <= (-1.8d-63)) .or. (.not. (t <= 2300.0d0))) then
tmp = x * ((-2.0d0) / (z * t))
else
tmp = x * ((2.0d0 / y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.8e-63) || !(t <= 2300.0)) {
tmp = x * (-2.0 / (z * t));
} else {
tmp = x * ((2.0 / y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.8e-63) or not (t <= 2300.0): tmp = x * (-2.0 / (z * t)) else: tmp = x * ((2.0 / y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.8e-63) || !(t <= 2300.0)) tmp = Float64(x * Float64(-2.0 / Float64(z * t))); else tmp = Float64(x * Float64(Float64(2.0 / y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.8e-63) || ~((t <= 2300.0))) tmp = x * (-2.0 / (z * t)); else tmp = x * ((2.0 / y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.8e-63], N[Not[LessEqual[t, 2300.0]], $MachinePrecision]], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-63} \lor \neg \left(t \leq 2300\right):\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\end{array}
\end{array}
if t < -1.80000000000000004e-63 or 2300 < t Initial program 90.4%
*-commutative90.4%
associate-*r/90.4%
distribute-rgt-out--91.1%
associate-/r*91.2%
Simplified91.2%
Taylor expanded in x around 0 91.1%
associate-*r/91.1%
*-commutative91.1%
times-frac91.2%
associate-*l/93.4%
associate-*r/91.6%
Simplified91.6%
Taylor expanded in y around 0 75.5%
*-commutative75.5%
Simplified75.5%
if -1.80000000000000004e-63 < t < 2300Initial program 95.5%
*-commutative95.5%
associate-*r/95.5%
distribute-rgt-out--97.3%
associate-/r*88.0%
Simplified88.0%
Taylor expanded in x around 0 97.3%
associate-*r/97.3%
*-commutative97.3%
times-frac87.8%
associate-*l/97.1%
associate-*r/97.2%
Simplified97.2%
Taylor expanded in y around inf 80.9%
associate-/r*80.9%
Simplified80.9%
Final simplification77.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.4e-63) (not (<= t 115000.0))) (* x (/ -2.0 (* z t))) (* (/ 2.0 z) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.4e-63) || !(t <= 115000.0)) {
tmp = x * (-2.0 / (z * t));
} else {
tmp = (2.0 / z) * (x / 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 ((t <= (-3.4d-63)) .or. (.not. (t <= 115000.0d0))) then
tmp = x * ((-2.0d0) / (z * t))
else
tmp = (2.0d0 / z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.4e-63) || !(t <= 115000.0)) {
tmp = x * (-2.0 / (z * t));
} else {
tmp = (2.0 / z) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.4e-63) or not (t <= 115000.0): tmp = x * (-2.0 / (z * t)) else: tmp = (2.0 / z) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.4e-63) || !(t <= 115000.0)) tmp = Float64(x * Float64(-2.0 / Float64(z * t))); else tmp = Float64(Float64(2.0 / z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.4e-63) || ~((t <= 115000.0))) tmp = x * (-2.0 / (z * t)); else tmp = (2.0 / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.4e-63], N[Not[LessEqual[t, 115000.0]], $MachinePrecision]], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-63} \lor \neg \left(t \leq 115000\right):\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if t < -3.39999999999999998e-63 or 115000 < t Initial program 90.4%
*-commutative90.4%
associate-*r/90.4%
distribute-rgt-out--91.1%
associate-/r*91.2%
Simplified91.2%
Taylor expanded in x around 0 91.1%
associate-*r/91.1%
*-commutative91.1%
times-frac91.2%
associate-*l/93.4%
associate-*r/91.6%
Simplified91.6%
Taylor expanded in y around 0 75.5%
*-commutative75.5%
Simplified75.5%
if -3.39999999999999998e-63 < t < 115000Initial program 95.5%
*-commutative95.5%
distribute-rgt-out--97.3%
times-frac97.1%
Simplified97.1%
Taylor expanded in y around inf 81.6%
Final simplification78.2%
(FPCore (x y z t) :precision binary64 (if (<= y 8.5e+149) (* 2.0 (/ (/ x z) (- y t))) (/ (* 2.0 x) (* y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 8.5e+149) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * 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) :: tmp
if (y <= 8.5d+149) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = (2.0d0 * x) / (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 8.5e+149) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * x) / (y * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 8.5e+149: tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (2.0 * x) / (y * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 8.5e+149) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(2.0 * x) / Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 8.5e+149) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (2.0 * x) / (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 8.5e+149], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+149}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{y \cdot z}\\
\end{array}
\end{array}
if y < 8.49999999999999956e149Initial program 91.9%
*-commutative91.9%
associate-*r/91.9%
distribute-rgt-out--93.2%
associate-/r*92.4%
Simplified92.4%
if 8.49999999999999956e149 < y Initial program 99.8%
distribute-rgt-out--99.8%
Simplified99.8%
Taylor expanded in y around inf 91.4%
*-commutative91.4%
Simplified91.4%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (* x (/ -2.0 (* z t))))
double code(double x, double y, double z, double t) {
return x * (-2.0 / (z * t));
}
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 * ((-2.0d0) / (z * t))
end function
public static double code(double x, double y, double z, double t) {
return x * (-2.0 / (z * t));
}
def code(x, y, z, t): return x * (-2.0 / (z * t))
function code(x, y, z, t) return Float64(x * Float64(-2.0 / Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x * (-2.0 / (z * t)); end
code[x_, y_, z_, t_] := N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{-2}{z \cdot t}
\end{array}
Initial program 92.7%
*-commutative92.7%
associate-*r/92.7%
distribute-rgt-out--93.8%
associate-/r*89.8%
Simplified89.8%
Taylor expanded in x around 0 93.8%
associate-*r/93.8%
*-commutative93.8%
times-frac89.7%
associate-*l/95.0%
associate-*r/94.1%
Simplified94.1%
Taylor expanded in y around 0 56.0%
*-commutative56.0%
Simplified56.0%
Final simplification56.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
(t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
(if (< t_2 -2.559141628295061e-13)
t_1
(if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} 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) :: t_2
real(8) :: tmp
t_1 = (x / ((y - t) * z)) * 2.0d0
t_2 = (x * 2.0d0) / ((y * z) - (t * z))
if (t_2 < (-2.559141628295061d-13)) then
tmp = t_1
else if (t_2 < 1.045027827330126d-269) then
tmp = ((x / z) * 2.0d0) / (y - t)
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 / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / ((y - t) * z)) * 2.0 t_2 = (x * 2.0) / ((y * z) - (t * z)) tmp = 0 if t_2 < -2.559141628295061e-13: tmp = t_1 elif t_2 < 1.045027827330126e-269: tmp = ((x / z) * 2.0) / (y - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0) t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) tmp = 0.0 if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / ((y - t) * z)) * 2.0; t_2 = (x * 2.0) / ((y * z) - (t * z)); tmp = 0.0; if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = ((x / z) * 2.0) / (y - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023275
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))