
(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 14 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 (if (<= (/ (* x 2.0) (- (* y z) (* z t))) 0.0) (* (/ 2.0 z) (/ x (- y t))) (/ (* x 2.0) (* z (- y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * 2.0) / ((y * z) - (z * t))) <= 0.0) {
tmp = (2.0 / z) * (x / (y - t));
} else {
tmp = (x * 2.0) / (z * (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 (((x * 2.0d0) / ((y * z) - (z * t))) <= 0.0d0) then
tmp = (2.0d0 / z) * (x / (y - t))
else
tmp = (x * 2.0d0) / (z * (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * 2.0) / ((y * z) - (z * t))) <= 0.0) {
tmp = (2.0 / z) * (x / (y - t));
} else {
tmp = (x * 2.0) / (z * (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * 2.0) / ((y * z) - (z * t))) <= 0.0: tmp = (2.0 / z) * (x / (y - t)) else: tmp = (x * 2.0) / (z * (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(z * t))) <= 0.0) tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t))); else tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * 2.0) / ((y * z) - (z * t))) <= 0.0) tmp = (2.0 / z) * (x / (y - t)); else tmp = (x * 2.0) / (z * (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot 2}{y \cdot z - z \cdot t} \leq 0:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 0.0Initial program 89.6%
*-commutative89.6%
distribute-rgt-out--90.2%
times-frac97.2%
Simplified97.2%
if 0.0 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 93.0%
distribute-rgt-out--99.7%
Simplified99.7%
Final simplification98.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (* x 2.0) -5e-169) (not (<= (* x 2.0) 2e-32))) (* (/ 2.0 z) (/ x (- y t))) (* x (/ 2.0 (* z (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * 2.0) <= -5e-169) || !((x * 2.0) <= 2e-32)) {
tmp = (2.0 / z) * (x / (y - t));
} else {
tmp = x * (2.0 / (z * (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 (((x * 2.0d0) <= (-5d-169)) .or. (.not. ((x * 2.0d0) <= 2d-32))) then
tmp = (2.0d0 / z) * (x / (y - t))
else
tmp = x * (2.0d0 / (z * (y - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * 2.0) <= -5e-169) || !((x * 2.0) <= 2e-32)) {
tmp = (2.0 / z) * (x / (y - t));
} else {
tmp = x * (2.0 / (z * (y - t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * 2.0) <= -5e-169) or not ((x * 2.0) <= 2e-32): tmp = (2.0 / z) * (x / (y - t)) else: tmp = x * (2.0 / (z * (y - t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x * 2.0) <= -5e-169) || !(Float64(x * 2.0) <= 2e-32)) tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t))); else tmp = Float64(x * Float64(2.0 / Float64(z * Float64(y - t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * 2.0) <= -5e-169) || ~(((x * 2.0) <= 2e-32))) tmp = (2.0 / z) * (x / (y - t)); else tmp = x * (2.0 / (z * (y - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x * 2.0), $MachinePrecision], -5e-169], N[Not[LessEqual[N[(x * 2.0), $MachinePrecision], 2e-32]], $MachinePrecision]], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{-169} \lor \neg \left(x \cdot 2 \leq 2 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if (*.f64 x 2) < -5.0000000000000002e-169 or 2.00000000000000011e-32 < (*.f64 x 2) Initial program 87.7%
*-commutative87.7%
distribute-rgt-out--91.1%
times-frac97.5%
Simplified97.5%
if -5.0000000000000002e-169 < (*.f64 x 2) < 2.00000000000000011e-32Initial program 97.4%
*-commutative97.4%
distribute-rgt-out--98.6%
times-frac84.2%
Simplified84.2%
Taylor expanded in z around 0 98.6%
*-commutative98.6%
associate-*l/98.6%
associate-*r/98.6%
Simplified98.6%
Final simplification97.8%
(FPCore (x y z t)
:precision binary64
(if (<= (* x 2.0) -5e-169)
(* (/ 2.0 z) (/ x (- y t)))
(if (<= (* x 2.0) 0.0001)
(* x (/ 2.0 (* z (- y t))))
(/ 2.0 (* z (/ (- y t) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * 2.0) <= -5e-169) {
tmp = (2.0 / z) * (x / (y - t));
} else if ((x * 2.0) <= 0.0001) {
tmp = x * (2.0 / (z * (y - t)));
} else {
tmp = 2.0 / (z * ((y - t) / 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 ((x * 2.0d0) <= (-5d-169)) then
tmp = (2.0d0 / z) * (x / (y - t))
else if ((x * 2.0d0) <= 0.0001d0) then
tmp = x * (2.0d0 / (z * (y - t)))
else
tmp = 2.0d0 / (z * ((y - t) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x * 2.0) <= -5e-169) {
tmp = (2.0 / z) * (x / (y - t));
} else if ((x * 2.0) <= 0.0001) {
tmp = x * (2.0 / (z * (y - t)));
} else {
tmp = 2.0 / (z * ((y - t) / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * 2.0) <= -5e-169: tmp = (2.0 / z) * (x / (y - t)) elif (x * 2.0) <= 0.0001: tmp = x * (2.0 / (z * (y - t))) else: tmp = 2.0 / (z * ((y - t) / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * 2.0) <= -5e-169) tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t))); elseif (Float64(x * 2.0) <= 0.0001) tmp = Float64(x * Float64(2.0 / Float64(z * Float64(y - t)))); else tmp = Float64(2.0 / Float64(z * Float64(Float64(y - t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * 2.0) <= -5e-169) tmp = (2.0 / z) * (x / (y - t)); elseif ((x * 2.0) <= 0.0001) tmp = x * (2.0 / (z * (y - t))); else tmp = 2.0 / (z * ((y - t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], -5e-169], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 0.0001], N[(x * N[(2.0 / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(z * N[(N[(y - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{-169}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\mathbf{elif}\;x \cdot 2 \leq 0.0001:\\
\;\;\;\;x \cdot \frac{2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot \frac{y - t}{x}}\\
\end{array}
\end{array}
if (*.f64 x 2) < -5.0000000000000002e-169Initial program 90.5%
*-commutative90.5%
distribute-rgt-out--93.4%
times-frac97.0%
Simplified97.0%
if -5.0000000000000002e-169 < (*.f64 x 2) < 1.00000000000000005e-4Initial program 96.5%
*-commutative96.5%
distribute-rgt-out--98.7%
times-frac85.5%
Simplified85.5%
Taylor expanded in z around 0 98.7%
*-commutative98.7%
associate-*l/98.7%
associate-*r/98.7%
Simplified98.7%
if 1.00000000000000005e-4 < (*.f64 x 2) Initial program 83.2%
*-commutative83.2%
distribute-rgt-out--86.4%
times-frac98.0%
Simplified98.0%
clear-num97.9%
frac-times98.2%
metadata-eval98.2%
Applied egg-rr98.2%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -2.3e+47)
(and (not (<= t -1.22e-34)) (or (<= t -9e-100) (not (<= t 2.3e+54)))))
(* -2.0 (/ (/ x t) z))
(* (/ 2.0 z) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e+47) || (!(t <= -1.22e-34) && ((t <= -9e-100) || !(t <= 2.3e+54)))) {
tmp = -2.0 * ((x / t) / z);
} 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 <= (-2.3d+47)) .or. (.not. (t <= (-1.22d-34))) .and. (t <= (-9d-100)) .or. (.not. (t <= 2.3d+54))) then
tmp = (-2.0d0) * ((x / t) / z)
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 <= -2.3e+47) || (!(t <= -1.22e-34) && ((t <= -9e-100) || !(t <= 2.3e+54)))) {
tmp = -2.0 * ((x / t) / z);
} else {
tmp = (2.0 / z) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.3e+47) or (not (t <= -1.22e-34) and ((t <= -9e-100) or not (t <= 2.3e+54))): tmp = -2.0 * ((x / t) / z) else: tmp = (2.0 / z) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.3e+47) || (!(t <= -1.22e-34) && ((t <= -9e-100) || !(t <= 2.3e+54)))) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); 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 <= -2.3e+47) || (~((t <= -1.22e-34)) && ((t <= -9e-100) || ~((t <= 2.3e+54))))) tmp = -2.0 * ((x / t) / z); else tmp = (2.0 / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.3e+47], And[N[Not[LessEqual[t, -1.22e-34]], $MachinePrecision], Or[LessEqual[t, -9e-100], N[Not[LessEqual[t, 2.3e+54]], $MachinePrecision]]]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+47} \lor \neg \left(t \leq -1.22 \cdot 10^{-34}\right) \land \left(t \leq -9 \cdot 10^{-100} \lor \neg \left(t \leq 2.3 \cdot 10^{+54}\right)\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if t < -2.2999999999999999e47 or -1.22e-34 < t < -9.0000000000000002e-100 or 2.29999999999999994e54 < t Initial program 86.5%
*-commutative86.5%
distribute-rgt-out--90.6%
times-frac94.1%
Simplified94.1%
Taylor expanded in z around 0 90.6%
*-commutative90.6%
associate-*l/90.6%
associate-*r/90.6%
Simplified90.6%
Taylor expanded in y around 0 83.9%
associate-/r*86.4%
Simplified86.4%
if -2.2999999999999999e47 < t < -1.22e-34 or -9.0000000000000002e-100 < t < 2.29999999999999994e54Initial program 94.7%
*-commutative94.7%
distribute-rgt-out--96.2%
times-frac92.5%
Simplified92.5%
Taylor expanded in y around inf 76.1%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.35e+47)
(* -2.0 (/ (/ x t) z))
(if (or (<= t -3.05e-34) (and (not (<= t -2.3e-100)) (<= t 1.08e+55)))
(* (/ 2.0 z) (/ x y))
(* (/ x t) (/ -2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e+47) {
tmp = -2.0 * ((x / t) / z);
} else if ((t <= -3.05e-34) || (!(t <= -2.3e-100) && (t <= 1.08e+55))) {
tmp = (2.0 / z) * (x / y);
} else {
tmp = (x / t) * (-2.0 / 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.35d+47)) then
tmp = (-2.0d0) * ((x / t) / z)
else if ((t <= (-3.05d-34)) .or. (.not. (t <= (-2.3d-100))) .and. (t <= 1.08d+55)) then
tmp = (2.0d0 / z) * (x / y)
else
tmp = (x / t) * ((-2.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e+47) {
tmp = -2.0 * ((x / t) / z);
} else if ((t <= -3.05e-34) || (!(t <= -2.3e-100) && (t <= 1.08e+55))) {
tmp = (2.0 / z) * (x / y);
} else {
tmp = (x / t) * (-2.0 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.35e+47: tmp = -2.0 * ((x / t) / z) elif (t <= -3.05e-34) or (not (t <= -2.3e-100) and (t <= 1.08e+55)): tmp = (2.0 / z) * (x / y) else: tmp = (x / t) * (-2.0 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.35e+47) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif ((t <= -3.05e-34) || (!(t <= -2.3e-100) && (t <= 1.08e+55))) tmp = Float64(Float64(2.0 / z) * Float64(x / y)); else tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.35e+47) tmp = -2.0 * ((x / t) / z); elseif ((t <= -3.05e-34) || (~((t <= -2.3e-100)) && (t <= 1.08e+55))) tmp = (2.0 / z) * (x / y); else tmp = (x / t) * (-2.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.35e+47], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -3.05e-34], And[N[Not[LessEqual[t, -2.3e-100]], $MachinePrecision], LessEqual[t, 1.08e+55]]], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+47}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq -3.05 \cdot 10^{-34} \lor \neg \left(t \leq -2.3 \cdot 10^{-100}\right) \land t \leq 1.08 \cdot 10^{+55}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\end{array}
\end{array}
if t < -1.34999999999999998e47Initial program 88.6%
*-commutative88.6%
distribute-rgt-out--91.5%
times-frac95.2%
Simplified95.2%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*l/91.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
associate-/r*85.1%
Simplified85.1%
if -1.34999999999999998e47 < t < -3.0499999999999999e-34 or -2.29999999999999994e-100 < t < 1.08000000000000004e55Initial program 94.7%
*-commutative94.7%
distribute-rgt-out--96.2%
times-frac92.5%
Simplified92.5%
Taylor expanded in y around inf 76.1%
if -3.0499999999999999e-34 < t < -2.29999999999999994e-100 or 1.08000000000000004e55 < t Initial program 83.8%
*-commutative83.8%
distribute-rgt-out--89.4%
times-frac92.8%
Simplified92.8%
Taylor expanded in z around 0 89.4%
*-commutative89.4%
associate-*l/89.4%
associate-*r/89.3%
Simplified89.3%
Taylor expanded in y around 0 85.5%
associate-/r*88.0%
Simplified88.0%
*-commutative88.0%
associate-/l/85.5%
associate-*l/85.5%
times-frac86.6%
associate-*l/88.1%
Applied egg-rr88.1%
associate-*r/88.0%
associate-/r*85.5%
times-frac88.0%
Applied egg-rr88.0%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= t -1.5e+47)
(* -2.0 (/ (/ x t) z))
(if (<= t -1.3e-29)
t_1
(if (<= t -4.5e-100)
(* (/ x t) (/ -2.0 z))
(if (<= t 1.08e+55) t_1 (* (/ x z) (/ -2.0 t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -1.5e+47) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -1.3e-29) {
tmp = t_1;
} else if (t <= -4.5e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 1.08e+55) {
tmp = t_1;
} else {
tmp = (x / z) * (-2.0 / 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.5d+47)) then
tmp = (-2.0d0) * ((x / t) / z)
else if (t <= (-1.3d-29)) then
tmp = t_1
else if (t <= (-4.5d-100)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 1.08d+55) then
tmp = t_1
else
tmp = (x / z) * ((-2.0d0) / 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.5e+47) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -1.3e-29) {
tmp = t_1;
} else if (t <= -4.5e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 1.08e+55) {
tmp = t_1;
} else {
tmp = (x / z) * (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) tmp = 0 if t <= -1.5e+47: tmp = -2.0 * ((x / t) / z) elif t <= -1.3e-29: tmp = t_1 elif t <= -4.5e-100: tmp = (x / t) * (-2.0 / z) elif t <= 1.08e+55: tmp = t_1 else: tmp = (x / z) * (-2.0 / 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.5e+47) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif (t <= -1.3e-29) tmp = t_1; elseif (t <= -4.5e-100) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 1.08e+55) tmp = t_1; else tmp = Float64(Float64(x / z) * Float64(-2.0 / 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.5e+47) tmp = -2.0 * ((x / t) / z); elseif (t <= -1.3e-29) tmp = t_1; elseif (t <= -4.5e-100) tmp = (x / t) * (-2.0 / z); elseif (t <= 1.08e+55) tmp = t_1; else tmp = (x / z) * (-2.0 / 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.5e+47], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.3e-29], t$95$1, If[LessEqual[t, -4.5e-100], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.08e+55], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+47}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -1.5000000000000001e47Initial program 88.6%
*-commutative88.6%
distribute-rgt-out--91.5%
times-frac95.2%
Simplified95.2%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*l/91.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
associate-/r*85.1%
Simplified85.1%
if -1.5000000000000001e47 < t < -1.3000000000000001e-29 or -4.5000000000000001e-100 < t < 1.08000000000000004e55Initial program 94.7%
*-commutative94.7%
distribute-rgt-out--96.2%
times-frac92.5%
Simplified92.5%
Taylor expanded in y around inf 76.1%
if -1.3000000000000001e-29 < t < -4.5000000000000001e-100Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 99.6%
associate-/r*99.7%
Simplified99.7%
*-commutative99.7%
associate-/l/99.6%
associate-*l/99.6%
times-frac91.4%
associate-*l/99.9%
Applied egg-rr99.9%
associate-*r/99.7%
associate-/r*99.6%
times-frac99.9%
Applied egg-rr99.9%
if 1.08000000000000004e55 < t Initial program 79.8%
*-commutative79.8%
distribute-rgt-out--86.8%
times-frac90.9%
Simplified90.9%
Taylor expanded in y around 0 81.9%
associate-*r/81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
times-frac85.4%
Applied egg-rr85.4%
Final simplification81.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) (/ 2.0 y))))
(if (<= t -2.5e+47)
(* -2.0 (/ (/ x t) z))
(if (<= t -1.25e-35)
t_1
(if (<= t -8.5e-100)
(* (/ x t) (/ -2.0 z))
(if (<= t 8.5e+53) t_1 (* (/ x z) (/ -2.0 t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (2.0 / y);
double tmp;
if (t <= -2.5e+47) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -1.25e-35) {
tmp = t_1;
} else if (t <= -8.5e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 8.5e+53) {
tmp = t_1;
} else {
tmp = (x / z) * (-2.0 / 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 = (x / z) * (2.0d0 / y)
if (t <= (-2.5d+47)) then
tmp = (-2.0d0) * ((x / t) / z)
else if (t <= (-1.25d-35)) then
tmp = t_1
else if (t <= (-8.5d-100)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 8.5d+53) then
tmp = t_1
else
tmp = (x / z) * ((-2.0d0) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (2.0 / y);
double tmp;
if (t <= -2.5e+47) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -1.25e-35) {
tmp = t_1;
} else if (t <= -8.5e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 8.5e+53) {
tmp = t_1;
} else {
tmp = (x / z) * (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * (2.0 / y) tmp = 0 if t <= -2.5e+47: tmp = -2.0 * ((x / t) / z) elif t <= -1.25e-35: tmp = t_1 elif t <= -8.5e-100: tmp = (x / t) * (-2.0 / z) elif t <= 8.5e+53: tmp = t_1 else: tmp = (x / z) * (-2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * Float64(2.0 / y)) tmp = 0.0 if (t <= -2.5e+47) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif (t <= -1.25e-35) tmp = t_1; elseif (t <= -8.5e-100) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 8.5e+53) tmp = t_1; else tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * (2.0 / y); tmp = 0.0; if (t <= -2.5e+47) tmp = -2.0 * ((x / t) / z); elseif (t <= -1.25e-35) tmp = t_1; elseif (t <= -8.5e-100) tmp = (x / t) * (-2.0 / z); elseif (t <= 8.5e+53) tmp = t_1; else tmp = (x / z) * (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e+47], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.25e-35], t$95$1, If[LessEqual[t, -8.5e-100], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+53], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+47}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -2.50000000000000011e47Initial program 88.6%
*-commutative88.6%
distribute-rgt-out--91.5%
times-frac95.2%
Simplified95.2%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*l/91.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
associate-/r*85.1%
Simplified85.1%
if -2.50000000000000011e47 < t < -1.24999999999999991e-35 or -8.50000000000000017e-100 < t < 8.5000000000000002e53Initial program 94.7%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
Simplified80.4%
times-frac78.8%
Applied egg-rr78.8%
if -1.24999999999999991e-35 < t < -8.50000000000000017e-100Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 99.6%
associate-/r*99.7%
Simplified99.7%
*-commutative99.7%
associate-/l/99.6%
associate-*l/99.6%
times-frac91.4%
associate-*l/99.9%
Applied egg-rr99.9%
associate-*r/99.7%
associate-/r*99.6%
times-frac99.9%
Applied egg-rr99.9%
if 8.5000000000000002e53 < t Initial program 79.8%
*-commutative79.8%
distribute-rgt-out--86.8%
times-frac90.9%
Simplified90.9%
Taylor expanded in y around 0 81.9%
associate-*r/81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
times-frac85.4%
Applied egg-rr85.4%
Final simplification82.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) (/ 2.0 y))))
(if (<= t -4.2e+48)
(* -2.0 (/ (/ x t) z))
(if (<= t -4.9e-26)
t_1
(if (<= t -9e-100)
(* (/ x t) (/ -2.0 z))
(if (<= t 1.12e+54) t_1 (/ -2.0 (* t (/ z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (2.0 / y);
double tmp;
if (t <= -4.2e+48) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -4.9e-26) {
tmp = t_1;
} else if (t <= -9e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 1.12e+54) {
tmp = t_1;
} else {
tmp = -2.0 / (t * (z / 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) :: t_1
real(8) :: tmp
t_1 = (x / z) * (2.0d0 / y)
if (t <= (-4.2d+48)) then
tmp = (-2.0d0) * ((x / t) / z)
else if (t <= (-4.9d-26)) then
tmp = t_1
else if (t <= (-9d-100)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 1.12d+54) then
tmp = t_1
else
tmp = (-2.0d0) / (t * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (2.0 / y);
double tmp;
if (t <= -4.2e+48) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -4.9e-26) {
tmp = t_1;
} else if (t <= -9e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 1.12e+54) {
tmp = t_1;
} else {
tmp = -2.0 / (t * (z / x));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * (2.0 / y) tmp = 0 if t <= -4.2e+48: tmp = -2.0 * ((x / t) / z) elif t <= -4.9e-26: tmp = t_1 elif t <= -9e-100: tmp = (x / t) * (-2.0 / z) elif t <= 1.12e+54: tmp = t_1 else: tmp = -2.0 / (t * (z / x)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * Float64(2.0 / y)) tmp = 0.0 if (t <= -4.2e+48) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif (t <= -4.9e-26) tmp = t_1; elseif (t <= -9e-100) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 1.12e+54) tmp = t_1; else tmp = Float64(-2.0 / Float64(t * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * (2.0 / y); tmp = 0.0; if (t <= -4.2e+48) tmp = -2.0 * ((x / t) / z); elseif (t <= -4.9e-26) tmp = t_1; elseif (t <= -9e-100) tmp = (x / t) * (-2.0 / z); elseif (t <= 1.12e+54) tmp = t_1; else tmp = -2.0 / (t * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+48], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.9e-26], t$95$1, If[LessEqual[t, -9e-100], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+54], t$95$1, N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+48}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq -4.9 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if t < -4.1999999999999997e48Initial program 88.6%
*-commutative88.6%
distribute-rgt-out--91.5%
times-frac95.2%
Simplified95.2%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*l/91.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
associate-/r*85.1%
Simplified85.1%
if -4.1999999999999997e48 < t < -4.8999999999999999e-26 or -9.0000000000000002e-100 < t < 1.12e54Initial program 94.7%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
Simplified80.4%
times-frac78.8%
Applied egg-rr78.8%
if -4.8999999999999999e-26 < t < -9.0000000000000002e-100Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 99.6%
associate-/r*99.7%
Simplified99.7%
*-commutative99.7%
associate-/l/99.6%
associate-*l/99.6%
times-frac91.4%
associate-*l/99.9%
Applied egg-rr99.9%
associate-*r/99.7%
associate-/r*99.6%
times-frac99.9%
Applied egg-rr99.9%
if 1.12e54 < t Initial program 79.8%
*-commutative79.8%
distribute-rgt-out--86.8%
times-frac90.9%
Simplified90.9%
Taylor expanded in y around 0 81.9%
associate-*r/81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
times-frac85.4%
Applied egg-rr85.4%
*-commutative85.4%
clear-num85.4%
frac-times87.2%
metadata-eval87.2%
Applied egg-rr87.2%
Final simplification82.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x 2.0) (* y z))))
(if (<= t -1.2e+48)
(* -2.0 (/ (/ x t) z))
(if (<= t -1.02e-35)
t_1
(if (<= t -2.4e-100)
(* (/ x t) (/ -2.0 z))
(if (<= t 9e+53) t_1 (/ -2.0 (* t (/ z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 2.0) / (y * z);
double tmp;
if (t <= -1.2e+48) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -1.02e-35) {
tmp = t_1;
} else if (t <= -2.4e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 9e+53) {
tmp = t_1;
} else {
tmp = -2.0 / (t * (z / 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) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) / (y * z)
if (t <= (-1.2d+48)) then
tmp = (-2.0d0) * ((x / t) / z)
else if (t <= (-1.02d-35)) then
tmp = t_1
else if (t <= (-2.4d-100)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 9d+53) then
tmp = t_1
else
tmp = (-2.0d0) / (t * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 2.0) / (y * z);
double tmp;
if (t <= -1.2e+48) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= -1.02e-35) {
tmp = t_1;
} else if (t <= -2.4e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 9e+53) {
tmp = t_1;
} else {
tmp = -2.0 / (t * (z / x));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 2.0) / (y * z) tmp = 0 if t <= -1.2e+48: tmp = -2.0 * ((x / t) / z) elif t <= -1.02e-35: tmp = t_1 elif t <= -2.4e-100: tmp = (x / t) * (-2.0 / z) elif t <= 9e+53: tmp = t_1 else: tmp = -2.0 / (t * (z / x)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 2.0) / Float64(y * z)) tmp = 0.0 if (t <= -1.2e+48) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif (t <= -1.02e-35) tmp = t_1; elseif (t <= -2.4e-100) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 9e+53) tmp = t_1; else tmp = Float64(-2.0 / Float64(t * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 2.0) / (y * z); tmp = 0.0; if (t <= -1.2e+48) tmp = -2.0 * ((x / t) / z); elseif (t <= -1.02e-35) tmp = t_1; elseif (t <= -2.4e-100) tmp = (x / t) * (-2.0 / z); elseif (t <= 9e+53) tmp = t_1; else tmp = -2.0 / (t * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e+48], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.02e-35], t$95$1, If[LessEqual[t, -2.4e-100], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+53], t$95$1, N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot 2}{y \cdot z}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{+48}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq -1.02 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if t < -1.2000000000000001e48Initial program 88.6%
*-commutative88.6%
distribute-rgt-out--91.5%
times-frac95.2%
Simplified95.2%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*l/91.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
associate-/r*85.1%
Simplified85.1%
if -1.2000000000000001e48 < t < -1.01999999999999995e-35 or -2.4000000000000003e-100 < t < 9.0000000000000004e53Initial program 94.7%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
Simplified80.4%
if -1.01999999999999995e-35 < t < -2.4000000000000003e-100Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 99.6%
associate-/r*99.7%
Simplified99.7%
*-commutative99.7%
associate-/l/99.6%
associate-*l/99.6%
times-frac91.4%
associate-*l/99.9%
Applied egg-rr99.9%
associate-*r/99.7%
associate-/r*99.6%
times-frac99.9%
Applied egg-rr99.9%
if 9.0000000000000004e53 < t Initial program 79.8%
*-commutative79.8%
distribute-rgt-out--86.8%
times-frac90.9%
Simplified90.9%
Taylor expanded in y around 0 81.9%
associate-*r/81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
times-frac85.4%
Applied egg-rr85.4%
*-commutative85.4%
clear-num85.4%
frac-times87.2%
metadata-eval87.2%
Applied egg-rr87.2%
Final simplification83.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x 2.0) (* y z))))
(if (<= t -1.36e+47)
(/ (* x (/ -2.0 t)) z)
(if (<= t -5.9e-25)
t_1
(if (<= t -9e-100)
(* (/ x t) (/ -2.0 z))
(if (<= t 8e+53) t_1 (/ -2.0 (* t (/ z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 2.0) / (y * z);
double tmp;
if (t <= -1.36e+47) {
tmp = (x * (-2.0 / t)) / z;
} else if (t <= -5.9e-25) {
tmp = t_1;
} else if (t <= -9e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 8e+53) {
tmp = t_1;
} else {
tmp = -2.0 / (t * (z / 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) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) / (y * z)
if (t <= (-1.36d+47)) then
tmp = (x * ((-2.0d0) / t)) / z
else if (t <= (-5.9d-25)) then
tmp = t_1
else if (t <= (-9d-100)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (t <= 8d+53) then
tmp = t_1
else
tmp = (-2.0d0) / (t * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 2.0) / (y * z);
double tmp;
if (t <= -1.36e+47) {
tmp = (x * (-2.0 / t)) / z;
} else if (t <= -5.9e-25) {
tmp = t_1;
} else if (t <= -9e-100) {
tmp = (x / t) * (-2.0 / z);
} else if (t <= 8e+53) {
tmp = t_1;
} else {
tmp = -2.0 / (t * (z / x));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 2.0) / (y * z) tmp = 0 if t <= -1.36e+47: tmp = (x * (-2.0 / t)) / z elif t <= -5.9e-25: tmp = t_1 elif t <= -9e-100: tmp = (x / t) * (-2.0 / z) elif t <= 8e+53: tmp = t_1 else: tmp = -2.0 / (t * (z / x)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 2.0) / Float64(y * z)) tmp = 0.0 if (t <= -1.36e+47) tmp = Float64(Float64(x * Float64(-2.0 / t)) / z); elseif (t <= -5.9e-25) tmp = t_1; elseif (t <= -9e-100) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (t <= 8e+53) tmp = t_1; else tmp = Float64(-2.0 / Float64(t * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 2.0) / (y * z); tmp = 0.0; if (t <= -1.36e+47) tmp = (x * (-2.0 / t)) / z; elseif (t <= -5.9e-25) tmp = t_1; elseif (t <= -9e-100) tmp = (x / t) * (-2.0 / z); elseif (t <= 8e+53) tmp = t_1; else tmp = -2.0 / (t * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.36e+47], N[(N[(x * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, -5.9e-25], t$95$1, If[LessEqual[t, -9e-100], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e+53], t$95$1, N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot 2}{y \cdot z}\\
\mathbf{if}\;t \leq -1.36 \cdot 10^{+47}:\\
\;\;\;\;\frac{x \cdot \frac{-2}{t}}{z}\\
\mathbf{elif}\;t \leq -5.9 \cdot 10^{-25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if t < -1.3599999999999999e47Initial program 88.6%
*-commutative88.6%
distribute-rgt-out--91.5%
times-frac95.2%
Simplified95.2%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*l/91.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
associate-/r*85.1%
Simplified85.1%
*-commutative85.1%
associate-/l/82.7%
associate-*l/82.7%
times-frac80.7%
associate-*l/85.3%
Applied egg-rr85.3%
if -1.3599999999999999e47 < t < -5.8999999999999998e-25 or -9.0000000000000002e-100 < t < 7.9999999999999999e53Initial program 94.7%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
Simplified80.4%
if -5.8999999999999998e-25 < t < -9.0000000000000002e-100Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 99.6%
associate-/r*99.7%
Simplified99.7%
*-commutative99.7%
associate-/l/99.6%
associate-*l/99.6%
times-frac91.4%
associate-*l/99.9%
Applied egg-rr99.9%
associate-*r/99.7%
associate-/r*99.6%
times-frac99.9%
Applied egg-rr99.9%
if 7.9999999999999999e53 < t Initial program 79.8%
*-commutative79.8%
distribute-rgt-out--86.8%
times-frac90.9%
Simplified90.9%
Taylor expanded in y around 0 81.9%
associate-*r/81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
times-frac85.4%
Applied egg-rr85.4%
*-commutative85.4%
clear-num85.4%
frac-times87.2%
metadata-eval87.2%
Applied egg-rr87.2%
Final simplification83.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e+42) (not (<= z 7e+93))) (* 2.0 (/ (/ x z) (- y t))) (* x (/ 2.0 (* z (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e+42) || !(z <= 7e+93)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * (2.0 / (z * (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 <= (-6d+42)) .or. (.not. (z <= 7d+93))) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = x * (2.0d0 / (z * (y - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e+42) || !(z <= 7e+93)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * (2.0 / (z * (y - t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6e+42) or not (z <= 7e+93): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = x * (2.0 / (z * (y - t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6e+42) || !(z <= 7e+93)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(x * Float64(2.0 / Float64(z * Float64(y - t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6e+42) || ~((z <= 7e+93))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = x * (2.0 / (z * (y - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6e+42], N[Not[LessEqual[z, 7e+93]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+42} \lor \neg \left(z \leq 7 \cdot 10^{+93}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if z < -6.00000000000000058e42 or 6.99999999999999996e93 < z Initial program 79.7%
*-commutative79.7%
associate-*r/79.7%
distribute-rgt-out--85.7%
associate-/r*96.1%
Simplified96.1%
if -6.00000000000000058e42 < z < 6.99999999999999996e93Initial program 97.9%
*-commutative97.9%
distribute-rgt-out--98.5%
times-frac91.6%
Simplified91.6%
Taylor expanded in z around 0 98.5%
*-commutative98.5%
associate-*l/98.5%
associate-*r/98.4%
Simplified98.4%
Final simplification97.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e+213) (not (<= y 1.36e+143))) (* -2.0 (/ (/ x z) y)) (* -2.0 (/ (/ x t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+213) || !(y <= 1.36e+143)) {
tmp = -2.0 * ((x / z) / y);
} else {
tmp = -2.0 * ((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 ((y <= (-1.3d+213)) .or. (.not. (y <= 1.36d+143))) then
tmp = (-2.0d0) * ((x / z) / y)
else
tmp = (-2.0d0) * ((x / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+213) || !(y <= 1.36e+143)) {
tmp = -2.0 * ((x / z) / y);
} else {
tmp = -2.0 * ((x / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e+213) or not (y <= 1.36e+143): tmp = -2.0 * ((x / z) / y) else: tmp = -2.0 * ((x / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e+213) || !(y <= 1.36e+143)) tmp = Float64(-2.0 * Float64(Float64(x / z) / y)); else tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.3e+213) || ~((y <= 1.36e+143))) tmp = -2.0 * ((x / z) / y); else tmp = -2.0 * ((x / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e+213], N[Not[LessEqual[y, 1.36e+143]], $MachinePrecision]], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+213} \lor \neg \left(y \leq 1.36 \cdot 10^{+143}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -1.29999999999999999e213 or 1.3599999999999999e143 < y Initial program 90.0%
*-commutative90.0%
distribute-rgt-out--96.1%
times-frac95.5%
Simplified95.5%
Taylor expanded in y around inf 95.2%
frac-times95.7%
*-commutative95.7%
frac-2neg95.7%
distribute-lft-neg-in95.7%
add-sqr-sqrt59.4%
sqrt-unprod75.9%
sqr-neg75.9%
sqrt-unprod24.1%
add-sqr-sqrt60.8%
distribute-rgt-neg-in60.8%
Applied egg-rr60.8%
associate-/r*60.7%
associate-*l/60.7%
*-commutative60.7%
neg-mul-160.7%
times-frac60.7%
metadata-eval60.7%
Simplified60.7%
if -1.29999999999999999e213 < y < 1.3599999999999999e143Initial program 90.9%
*-commutative90.9%
distribute-rgt-out--92.9%
times-frac92.7%
Simplified92.7%
Taylor expanded in z around 0 92.9%
*-commutative92.9%
associate-*l/92.9%
associate-*r/92.8%
Simplified92.8%
Taylor expanded in y around 0 61.0%
associate-/r*63.1%
Simplified63.1%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (* 2.0 (/ (/ x z) (- y t))))
double code(double x, double y, double z, double t) {
return 2.0 * ((x / z) / (y - 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 = 2.0d0 * ((x / z) / (y - t))
end function
public static double code(double x, double y, double z, double t) {
return 2.0 * ((x / z) / (y - t));
}
def code(x, y, z, t): return 2.0 * ((x / z) / (y - t))
function code(x, y, z, t) return Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))) end
function tmp = code(x, y, z, t) tmp = 2.0 * ((x / z) / (y - t)); end
code[x_, y_, z_, t_] := N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\frac{x}{z}}{y - t}
\end{array}
Initial program 90.8%
*-commutative90.8%
associate-*r/90.8%
distribute-rgt-out--93.5%
associate-/r*91.6%
Simplified91.6%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (* -2.0 (/ (/ x t) z)))
double code(double x, double y, double z, double t) {
return -2.0 * ((x / 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 = (-2.0d0) * ((x / t) / z)
end function
public static double code(double x, double y, double z, double t) {
return -2.0 * ((x / t) / z);
}
def code(x, y, z, t): return -2.0 * ((x / t) / z)
function code(x, y, z, t) return Float64(-2.0 * Float64(Float64(x / t) / z)) end
function tmp = code(x, y, z, t) tmp = -2.0 * ((x / t) / z); end
code[x_, y_, z_, t_] := N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-2 \cdot \frac{\frac{x}{t}}{z}
\end{array}
Initial program 90.8%
*-commutative90.8%
distribute-rgt-out--93.5%
times-frac93.3%
Simplified93.3%
Taylor expanded in z around 0 93.5%
*-commutative93.5%
associate-*l/93.5%
associate-*r/93.4%
Simplified93.4%
Taylor expanded in y around 0 53.8%
associate-/r*54.9%
Simplified54.9%
Final simplification54.9%
(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 2023318
(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))))