
(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 13 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 (<= t_1 -1e+298)
(/ (/ x (- y t)) (* z 0.5))
(if (<= t_1 2e+247)
(/ (* x 2.0) (* 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 <= -1e+298) {
tmp = (x / (y - t)) / (z * 0.5);
} else if (t_1 <= 2e+247) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = 2.0 * ((x / 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) :: t_1
real(8) :: tmp
t_1 = (y * z) - (z * t)
if (t_1 <= (-1d+298)) then
tmp = (x / (y - t)) / (z * 0.5d0)
else if (t_1 <= 2d+247) then
tmp = (x * 2.0d0) / (z * (y - t))
else
tmp = 2.0d0 * ((x / z) / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if (t_1 <= -1e+298) {
tmp = (x / (y - t)) / (z * 0.5);
} else if (t_1 <= 2e+247) {
tmp = (x * 2.0) / (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 <= -1e+298: tmp = (x / (y - t)) / (z * 0.5) elif t_1 <= 2e+247: tmp = (x * 2.0) / (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 <= -1e+298) tmp = Float64(Float64(x / Float64(y - t)) / Float64(z * 0.5)); elseif (t_1 <= 2e+247) tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / 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 <= -1e+298) tmp = (x / (y - t)) / (z * 0.5); elseif (t_1 <= 2e+247) tmp = (x * 2.0) / (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[LessEqual[t$95$1, -1e+298], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(z * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+247], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / z), $MachinePrecision] / 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 -1 \cdot 10^{+298}:\\
\;\;\;\;\frac{\frac{x}{y - t}}{z \cdot 0.5}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+247}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -9.9999999999999996e297Initial program 59.3%
*-commutative59.3%
distribute-rgt-out--59.3%
times-frac99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
if -9.9999999999999996e297 < (-.f64 (*.f64 y z) (*.f64 t z)) < 1.9999999999999999e247Initial program 96.5%
distribute-rgt-out--97.7%
Simplified97.7%
if 1.9999999999999999e247 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 66.0%
*-commutative66.0%
associate-*r/66.0%
distribute-rgt-out--74.4%
associate-/r*99.9%
Simplified99.9%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1.5e-7)
(and (not (<= y -2.8e-66)) (or (<= y -6.5e-98) (not (<= y 6e-68)))))
(* (/ 2.0 z) (/ x y))
(* (/ x t) (/ -2.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.5e-7) || (!(y <= -2.8e-66) && ((y <= -6.5e-98) || !(y <= 6e-68)))) {
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 ((y <= (-1.5d-7)) .or. (.not. (y <= (-2.8d-66))) .and. (y <= (-6.5d-98)) .or. (.not. (y <= 6d-68))) 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 ((y <= -1.5e-7) || (!(y <= -2.8e-66) && ((y <= -6.5e-98) || !(y <= 6e-68)))) {
tmp = (2.0 / z) * (x / y);
} else {
tmp = (x / t) * (-2.0 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.5e-7) or (not (y <= -2.8e-66) and ((y <= -6.5e-98) or not (y <= 6e-68))): 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 ((y <= -1.5e-7) || (!(y <= -2.8e-66) && ((y <= -6.5e-98) || !(y <= 6e-68)))) 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 ((y <= -1.5e-7) || (~((y <= -2.8e-66)) && ((y <= -6.5e-98) || ~((y <= 6e-68))))) tmp = (2.0 / z) * (x / y); else tmp = (x / t) * (-2.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.5e-7], And[N[Not[LessEqual[y, -2.8e-66]], $MachinePrecision], Or[LessEqual[y, -6.5e-98], N[Not[LessEqual[y, 6e-68]], $MachinePrecision]]]], 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}\;y \leq -1.5 \cdot 10^{-7} \lor \neg \left(y \leq -2.8 \cdot 10^{-66}\right) \land \left(y \leq -6.5 \cdot 10^{-98} \lor \neg \left(y \leq 6 \cdot 10^{-68}\right)\right):\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\end{array}
\end{array}
if y < -1.4999999999999999e-7 or -2.8e-66 < y < -6.50000000000000017e-98 or 6e-68 < y Initial program 88.0%
*-commutative88.0%
distribute-rgt-out--90.7%
times-frac93.3%
Simplified93.3%
Taylor expanded in y around inf 79.2%
if -1.4999999999999999e-7 < y < -2.8e-66 or -6.50000000000000017e-98 < y < 6e-68Initial program 86.8%
*-commutative86.8%
distribute-rgt-out--88.7%
times-frac92.1%
Simplified92.1%
Taylor expanded in y around 0 76.3%
associate-*r/76.3%
*-commutative76.3%
*-commutative76.3%
Simplified76.3%
*-commutative76.3%
times-frac78.4%
Applied egg-rr78.4%
Final simplification78.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= y -4.5e-5)
t_1
(if (<= y -2.9e-66)
(* (/ x t) (/ -2.0 z))
(if (or (<= y -6.5e-98) (not (<= y 1.4e-67)))
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 (y <= -4.5e-5) {
tmp = t_1;
} else if (y <= -2.9e-66) {
tmp = (x / t) * (-2.0 / z);
} else if ((y <= -6.5e-98) || !(y <= 1.4e-67)) {
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 (y <= (-4.5d-5)) then
tmp = t_1
else if (y <= (-2.9d-66)) then
tmp = (x / t) * ((-2.0d0) / z)
else if ((y <= (-6.5d-98)) .or. (.not. (y <= 1.4d-67))) 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 (y <= -4.5e-5) {
tmp = t_1;
} else if (y <= -2.9e-66) {
tmp = (x / t) * (-2.0 / z);
} else if ((y <= -6.5e-98) || !(y <= 1.4e-67)) {
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 y <= -4.5e-5: tmp = t_1 elif y <= -2.9e-66: tmp = (x / t) * (-2.0 / z) elif (y <= -6.5e-98) or not (y <= 1.4e-67): 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 (y <= -4.5e-5) tmp = t_1; elseif (y <= -2.9e-66) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif ((y <= -6.5e-98) || !(y <= 1.4e-67)) 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 (y <= -4.5e-5) tmp = t_1; elseif (y <= -2.9e-66) tmp = (x / t) * (-2.0 / z); elseif ((y <= -6.5e-98) || ~((y <= 1.4e-67))) 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[y, -4.5e-5], t$95$1, If[LessEqual[y, -2.9e-66], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6.5e-98], N[Not[LessEqual[y, 1.4e-67]], $MachinePrecision]], 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}\;y \leq -4.5 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-98} \lor \neg \left(y \leq 1.4 \cdot 10^{-67}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if y < -4.50000000000000028e-5 or -2.90000000000000011e-66 < y < -6.50000000000000017e-98 or 1.40000000000000005e-67 < y Initial program 88.0%
*-commutative88.0%
distribute-rgt-out--90.7%
times-frac93.3%
Simplified93.3%
Taylor expanded in y around inf 79.2%
if -4.50000000000000028e-5 < y < -2.90000000000000011e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-commutative70.6%
Simplified70.6%
*-commutative70.6%
times-frac66.1%
Applied egg-rr66.1%
if -6.50000000000000017e-98 < y < 1.40000000000000005e-67Initial program 85.6%
distribute-rgt-out--87.9%
Simplified87.9%
times-frac95.5%
Applied egg-rr95.5%
Taylor expanded in y around 0 82.0%
Final simplification79.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.85e-5)
(* (/ 2.0 z) (/ x y))
(if (<= y -2.5e-66)
(/ (* x -2.0) (* z t))
(if (<= y -2.7e-98)
(/ 2.0 (/ (* y z) x))
(if (<= y 1.16e+24) (/ (* (/ x z) -2.0) t) (* (/ x z) (/ 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-5) {
tmp = (2.0 / z) * (x / y);
} else if (y <= -2.5e-66) {
tmp = (x * -2.0) / (z * t);
} else if (y <= -2.7e-98) {
tmp = 2.0 / ((y * z) / x);
} else if (y <= 1.16e+24) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = (x / z) * (2.0 / 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 (y <= (-1.85d-5)) then
tmp = (2.0d0 / z) * (x / y)
else if (y <= (-2.5d-66)) then
tmp = (x * (-2.0d0)) / (z * t)
else if (y <= (-2.7d-98)) then
tmp = 2.0d0 / ((y * z) / x)
else if (y <= 1.16d+24) then
tmp = ((x / z) * (-2.0d0)) / t
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-5) {
tmp = (2.0 / z) * (x / y);
} else if (y <= -2.5e-66) {
tmp = (x * -2.0) / (z * t);
} else if (y <= -2.7e-98) {
tmp = 2.0 / ((y * z) / x);
} else if (y <= 1.16e+24) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.85e-5: tmp = (2.0 / z) * (x / y) elif y <= -2.5e-66: tmp = (x * -2.0) / (z * t) elif y <= -2.7e-98: tmp = 2.0 / ((y * z) / x) elif y <= 1.16e+24: tmp = ((x / z) * -2.0) / t else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.85e-5) tmp = Float64(Float64(2.0 / z) * Float64(x / y)); elseif (y <= -2.5e-66) tmp = Float64(Float64(x * -2.0) / Float64(z * t)); elseif (y <= -2.7e-98) tmp = Float64(2.0 / Float64(Float64(y * z) / x)); elseif (y <= 1.16e+24) tmp = Float64(Float64(Float64(x / z) * -2.0) / t); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.85e-5) tmp = (2.0 / z) * (x / y); elseif (y <= -2.5e-66) tmp = (x * -2.0) / (z * t); elseif (y <= -2.7e-98) tmp = 2.0 / ((y * z) / x); elseif (y <= 1.16e+24) tmp = ((x / z) * -2.0) / t; else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.85e-5], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.5e-66], N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.7e-98], N[(2.0 / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e+24], N[(N[(N[(x / z), $MachinePrecision] * -2.0), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{x \cdot -2}{z \cdot t}\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-98}:\\
\;\;\;\;\frac{2}{\frac{y \cdot z}{x}}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+24}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -1.84999999999999991e-5Initial program 86.8%
*-commutative86.8%
distribute-rgt-out--91.9%
times-frac92.1%
Simplified92.1%
Taylor expanded in y around inf 87.0%
if -1.84999999999999991e-5 < y < -2.49999999999999981e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-commutative70.6%
Simplified70.6%
if -2.49999999999999981e-66 < y < -2.6999999999999999e-98Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.4%
Simplified99.4%
frac-times99.6%
*-commutative99.6%
times-frac99.6%
clear-num99.6%
frac-times99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.3%
if -2.6999999999999999e-98 < y < 1.16000000000000005e24Initial program 86.4%
*-commutative86.4%
distribute-rgt-out--88.2%
times-frac93.1%
Simplified93.1%
Taylor expanded in y around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
Simplified76.9%
frac-times72.6%
neg-mul-172.6%
associate-*r*72.6%
metadata-eval72.6%
*-commutative72.6%
associate-/r*78.3%
*-commutative78.3%
*-un-lft-identity78.3%
times-frac78.3%
metadata-eval78.3%
Applied egg-rr78.3%
if 1.16000000000000005e24 < y Initial program 86.9%
distribute-rgt-out--88.7%
Simplified88.7%
times-frac88.6%
Applied egg-rr88.6%
Taylor expanded in y around inf 79.6%
Final simplification80.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e-6)
(/ (* x (/ 2.0 y)) z)
(if (<= y -2.5e-66)
(/ (* x -2.0) (* z t))
(if (<= y -6.5e-98)
(/ 2.0 (/ (* y z) x))
(if (<= y 2.15e+30) (/ (* (/ x z) -2.0) t) (* (/ x z) (/ 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-6) {
tmp = (x * (2.0 / y)) / z;
} else if (y <= -2.5e-66) {
tmp = (x * -2.0) / (z * t);
} else if (y <= -6.5e-98) {
tmp = 2.0 / ((y * z) / x);
} else if (y <= 2.15e+30) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = (x / z) * (2.0 / 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 (y <= (-9d-6)) then
tmp = (x * (2.0d0 / y)) / z
else if (y <= (-2.5d-66)) then
tmp = (x * (-2.0d0)) / (z * t)
else if (y <= (-6.5d-98)) then
tmp = 2.0d0 / ((y * z) / x)
else if (y <= 2.15d+30) then
tmp = ((x / z) * (-2.0d0)) / t
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-6) {
tmp = (x * (2.0 / y)) / z;
} else if (y <= -2.5e-66) {
tmp = (x * -2.0) / (z * t);
} else if (y <= -6.5e-98) {
tmp = 2.0 / ((y * z) / x);
} else if (y <= 2.15e+30) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-6: tmp = (x * (2.0 / y)) / z elif y <= -2.5e-66: tmp = (x * -2.0) / (z * t) elif y <= -6.5e-98: tmp = 2.0 / ((y * z) / x) elif y <= 2.15e+30: tmp = ((x / z) * -2.0) / t else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-6) tmp = Float64(Float64(x * Float64(2.0 / y)) / z); elseif (y <= -2.5e-66) tmp = Float64(Float64(x * -2.0) / Float64(z * t)); elseif (y <= -6.5e-98) tmp = Float64(2.0 / Float64(Float64(y * z) / x)); elseif (y <= 2.15e+30) tmp = Float64(Float64(Float64(x / z) * -2.0) / t); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-6) tmp = (x * (2.0 / y)) / z; elseif (y <= -2.5e-66) tmp = (x * -2.0) / (z * t); elseif (y <= -6.5e-98) tmp = 2.0 / ((y * z) / x); elseif (y <= 2.15e+30) tmp = ((x / z) * -2.0) / t; else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-6], N[(N[(x * N[(2.0 / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -2.5e-66], N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.5e-98], N[(2.0 / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+30], N[(N[(N[(x / z), $MachinePrecision] * -2.0), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\
\;\;\;\;\frac{x \cdot \frac{2}{y}}{z}\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{x \cdot -2}{z \cdot t}\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{2}{\frac{y \cdot z}{x}}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -9.00000000000000023e-6Initial program 86.8%
distribute-rgt-out--91.9%
Simplified91.9%
times-frac91.8%
Applied egg-rr91.8%
Taylor expanded in y around inf 86.6%
associate-*l/87.1%
Applied egg-rr87.1%
if -9.00000000000000023e-6 < y < -2.49999999999999981e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-commutative70.6%
Simplified70.6%
if -2.49999999999999981e-66 < y < -6.50000000000000017e-98Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.4%
Simplified99.4%
frac-times99.6%
*-commutative99.6%
times-frac99.6%
clear-num99.6%
frac-times99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.3%
if -6.50000000000000017e-98 < y < 2.15e30Initial program 86.4%
*-commutative86.4%
distribute-rgt-out--88.2%
times-frac93.1%
Simplified93.1%
Taylor expanded in y around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
Simplified76.9%
frac-times72.6%
neg-mul-172.6%
associate-*r*72.6%
metadata-eval72.6%
*-commutative72.6%
associate-/r*78.3%
*-commutative78.3%
*-un-lft-identity78.3%
times-frac78.3%
metadata-eval78.3%
Applied egg-rr78.3%
if 2.15e30 < y Initial program 86.9%
distribute-rgt-out--88.7%
Simplified88.7%
times-frac88.6%
Applied egg-rr88.6%
Taylor expanded in y around inf 79.6%
Final simplification80.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ 2.0 y) (/ z x))))
(if (<= y -6.5e-10)
t_1
(if (<= y -3e-66)
(/ (* x -2.0) (* z t))
(if (<= y -6e-98)
(/ 2.0 (/ (* y z) x))
(if (<= y 4.7e+27) (/ (* (/ x z) -2.0) t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / y) / (z / x);
double tmp;
if (y <= -6.5e-10) {
tmp = t_1;
} else if (y <= -3e-66) {
tmp = (x * -2.0) / (z * t);
} else if (y <= -6e-98) {
tmp = 2.0 / ((y * z) / x);
} else if (y <= 4.7e+27) {
tmp = ((x / z) * -2.0) / 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) :: tmp
t_1 = (2.0d0 / y) / (z / x)
if (y <= (-6.5d-10)) then
tmp = t_1
else if (y <= (-3d-66)) then
tmp = (x * (-2.0d0)) / (z * t)
else if (y <= (-6d-98)) then
tmp = 2.0d0 / ((y * z) / x)
else if (y <= 4.7d+27) then
tmp = ((x / z) * (-2.0d0)) / 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 = (2.0 / y) / (z / x);
double tmp;
if (y <= -6.5e-10) {
tmp = t_1;
} else if (y <= -3e-66) {
tmp = (x * -2.0) / (z * t);
} else if (y <= -6e-98) {
tmp = 2.0 / ((y * z) / x);
} else if (y <= 4.7e+27) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / y) / (z / x) tmp = 0 if y <= -6.5e-10: tmp = t_1 elif y <= -3e-66: tmp = (x * -2.0) / (z * t) elif y <= -6e-98: tmp = 2.0 / ((y * z) / x) elif y <= 4.7e+27: tmp = ((x / z) * -2.0) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / y) / Float64(z / x)) tmp = 0.0 if (y <= -6.5e-10) tmp = t_1; elseif (y <= -3e-66) tmp = Float64(Float64(x * -2.0) / Float64(z * t)); elseif (y <= -6e-98) tmp = Float64(2.0 / Float64(Float64(y * z) / x)); elseif (y <= 4.7e+27) tmp = Float64(Float64(Float64(x / z) * -2.0) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / y) / (z / x); tmp = 0.0; if (y <= -6.5e-10) tmp = t_1; elseif (y <= -3e-66) tmp = (x * -2.0) / (z * t); elseif (y <= -6e-98) tmp = 2.0 / ((y * z) / x); elseif (y <= 4.7e+27) tmp = ((x / z) * -2.0) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e-10], t$95$1, If[LessEqual[y, -3e-66], N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e-98], N[(2.0 / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+27], N[(N[(N[(x / z), $MachinePrecision] * -2.0), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{y}}{\frac{z}{x}}\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-66}:\\
\;\;\;\;\frac{x \cdot -2}{z \cdot t}\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-98}:\\
\;\;\;\;\frac{2}{\frac{y \cdot z}{x}}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.5000000000000003e-10 or 4.69999999999999976e27 < y Initial program 86.8%
distribute-rgt-out--90.3%
Simplified90.3%
times-frac90.2%
Applied egg-rr90.2%
Taylor expanded in y around inf 83.1%
*-commutative83.1%
clear-num83.0%
un-div-inv84.2%
Applied egg-rr84.2%
if -6.5000000000000003e-10 < y < -3.0000000000000002e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-commutative70.6%
Simplified70.6%
if -3.0000000000000002e-66 < y < -6e-98Initial program 99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
times-frac99.4%
Simplified99.4%
frac-times99.6%
*-commutative99.6%
times-frac99.6%
clear-num99.6%
frac-times99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.3%
if -6e-98 < y < 4.69999999999999976e27Initial program 86.4%
*-commutative86.4%
distribute-rgt-out--88.2%
times-frac93.1%
Simplified93.1%
Taylor expanded in y around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
Simplified76.9%
frac-times72.6%
neg-mul-172.6%
associate-*r*72.6%
metadata-eval72.6%
*-commutative72.6%
associate-/r*78.3%
*-commutative78.3%
*-un-lft-identity78.3%
times-frac78.3%
metadata-eval78.3%
Applied egg-rr78.3%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.5e+145) (* (/ x (- y t)) (/ 2.0 z)) (if (<= z 3000.0) (/ (* x 2.0) (* z (- y t))) (* 2.0 (/ (/ x z) (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+145) {
tmp = (x / (y - t)) * (2.0 / z);
} else if (z <= 3000.0) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = 2.0 * ((x / 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 <= (-1.5d+145)) then
tmp = (x / (y - t)) * (2.0d0 / z)
else if (z <= 3000.0d0) then
tmp = (x * 2.0d0) / (z * (y - t))
else
tmp = 2.0d0 * ((x / 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 <= -1.5e+145) {
tmp = (x / (y - t)) * (2.0 / z);
} else if (z <= 3000.0) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = 2.0 * ((x / z) / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+145: tmp = (x / (y - t)) * (2.0 / z) elif z <= 3000.0: tmp = (x * 2.0) / (z * (y - t)) else: tmp = 2.0 * ((x / z) / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+145) tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z)); elseif (z <= 3000.0) tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.5e+145) tmp = (x / (y - t)) * (2.0 / z); elseif (z <= 3000.0) tmp = (x * 2.0) / (z * (y - t)); else tmp = 2.0 * ((x / z) / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e+145], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3000.0], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\mathbf{elif}\;z \leq 3000:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if z < -1.5000000000000001e145Initial program 69.1%
*-commutative69.1%
distribute-rgt-out--72.2%
times-frac99.8%
Simplified99.8%
if -1.5000000000000001e145 < z < 3e3Initial program 95.5%
distribute-rgt-out--96.8%
Simplified96.8%
if 3e3 < z Initial program 77.2%
*-commutative77.2%
associate-*r/77.2%
distribute-rgt-out--82.0%
associate-/r*98.2%
Simplified98.2%
Final simplification97.5%
(FPCore (x y z t) :precision binary64 (if (<= (* x 2.0) 2e-77) (* 2.0 (/ (/ x z) (- y t))) (* (/ x (- y t)) (/ 2.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * 2.0) <= 2e-77) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (x / (y - 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 ((x * 2.0d0) <= 2d-77) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = (x / (y - 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 ((x * 2.0) <= 2e-77) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * 2.0) <= 2e-77: tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (x / (y - t)) * (2.0 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * 2.0) <= 2e-77) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * 2.0) <= 2e-77) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (x / (y - t)) * (2.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], 2e-77], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 2 \cdot 10^{-77}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (*.f64 x 2) < 1.9999999999999999e-77Initial program 89.1%
*-commutative89.1%
associate-*r/89.1%
distribute-rgt-out--92.1%
associate-/r*94.2%
Simplified94.2%
if 1.9999999999999999e-77 < (*.f64 x 2) Initial program 84.1%
*-commutative84.1%
distribute-rgt-out--85.2%
times-frac98.5%
Simplified98.5%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (<= (* x 2.0) 5e-23) (/ 2.0 (* (- y t) (/ z x))) (* (/ x (- y t)) (/ 2.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * 2.0) <= 5e-23) {
tmp = 2.0 / ((y - t) * (z / x));
} else {
tmp = (x / (y - 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 ((x * 2.0d0) <= 5d-23) then
tmp = 2.0d0 / ((y - t) * (z / x))
else
tmp = (x / (y - 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 ((x * 2.0) <= 5e-23) {
tmp = 2.0 / ((y - t) * (z / x));
} else {
tmp = (x / (y - t)) * (2.0 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * 2.0) <= 5e-23: tmp = 2.0 / ((y - t) * (z / x)) else: tmp = (x / (y - t)) * (2.0 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * 2.0) <= 5e-23) tmp = Float64(2.0 / Float64(Float64(y - t) * Float64(z / x))); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * 2.0) <= 5e-23) tmp = 2.0 / ((y - t) * (z / x)); else tmp = (x / (y - t)) * (2.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], 5e-23], N[(2.0 / N[(N[(y - t), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 5 \cdot 10^{-23}:\\
\;\;\;\;\frac{2}{\left(y - t\right) \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (*.f64 x 2) < 5.0000000000000002e-23Initial program 89.8%
*-commutative89.8%
distribute-rgt-out--92.6%
times-frac90.5%
Simplified90.5%
frac-times92.6%
*-commutative92.6%
times-frac94.5%
clear-num94.4%
frac-times94.8%
metadata-eval94.8%
Applied egg-rr94.8%
if 5.0000000000000002e-23 < (*.f64 x 2) Initial program 81.7%
*-commutative81.7%
distribute-rgt-out--83.1%
times-frac98.3%
Simplified98.3%
Final simplification95.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.7e-98) (not (<= y 1.4e+24))) (* (/ x z) (/ 2.0 y)) (* (/ x z) (/ -2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.7e-98) || !(y <= 1.4e+24)) {
tmp = (x / z) * (2.0 / y);
} 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) :: tmp
if ((y <= (-5.7d-98)) .or. (.not. (y <= 1.4d+24))) then
tmp = (x / z) * (2.0d0 / y)
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 tmp;
if ((y <= -5.7e-98) || !(y <= 1.4e+24)) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = (x / z) * (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.7e-98) or not (y <= 1.4e+24): tmp = (x / z) * (2.0 / y) else: tmp = (x / z) * (-2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.7e-98) || !(y <= 1.4e+24)) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); else tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.7e-98) || ~((y <= 1.4e+24))) tmp = (x / z) * (2.0 / y); else tmp = (x / z) * (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.7e-98], N[Not[LessEqual[y, 1.4e+24]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.7 \cdot 10^{-98} \lor \neg \left(y \leq 1.4 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if y < -5.6999999999999998e-98 or 1.4000000000000001e24 < y Initial program 88.4%
distribute-rgt-out--91.2%
Simplified91.2%
times-frac91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 79.1%
if -5.6999999999999998e-98 < y < 1.4000000000000001e24Initial program 86.4%
distribute-rgt-out--88.2%
Simplified88.2%
times-frac95.3%
Applied egg-rr95.3%
Taylor expanded in y around 0 78.3%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (and (not (<= y -6.5e-98)) (<= y 2e+24)) (/ (* (/ x z) -2.0) t) (* (/ x z) (/ 2.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if (!(y <= -6.5e-98) && (y <= 2e+24)) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = (x / z) * (2.0 / 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 ((.not. (y <= (-6.5d-98))) .and. (y <= 2d+24)) then
tmp = ((x / z) * (-2.0d0)) / t
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (!(y <= -6.5e-98) && (y <= 2e+24)) {
tmp = ((x / z) * -2.0) / t;
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if not (y <= -6.5e-98) and (y <= 2e+24): tmp = ((x / z) * -2.0) / t else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (!(y <= -6.5e-98) && (y <= 2e+24)) tmp = Float64(Float64(Float64(x / z) * -2.0) / t); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (~((y <= -6.5e-98)) && (y <= 2e+24)) tmp = ((x / z) * -2.0) / t; else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[And[N[Not[LessEqual[y, -6.5e-98]], $MachinePrecision], LessEqual[y, 2e+24]], N[(N[(N[(x / z), $MachinePrecision] * -2.0), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\neg \left(y \leq -6.5 \cdot 10^{-98}\right) \land y \leq 2 \cdot 10^{+24}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -6.50000000000000017e-98 or 2e24 < y Initial program 88.4%
distribute-rgt-out--91.2%
Simplified91.2%
times-frac91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 79.1%
if -6.50000000000000017e-98 < y < 2e24Initial program 86.4%
*-commutative86.4%
distribute-rgt-out--88.2%
times-frac93.1%
Simplified93.1%
Taylor expanded in y around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
Simplified76.9%
frac-times72.6%
neg-mul-172.6%
associate-*r*72.6%
metadata-eval72.6%
*-commutative72.6%
associate-/r*78.3%
*-commutative78.3%
*-un-lft-identity78.3%
times-frac78.3%
metadata-eval78.3%
Applied egg-rr78.3%
Final simplification78.8%
(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 87.5%
*-commutative87.5%
associate-*r/87.5%
distribute-rgt-out--89.9%
associate-/r*93.0%
Simplified93.0%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (* (/ 2.0 z) (/ x y)))
double code(double x, double y, double z, double t) {
return (2.0 / z) * (x / y);
}
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 / z) * (x / y)
end function
public static double code(double x, double y, double z, double t) {
return (2.0 / z) * (x / y);
}
def code(x, y, z, t): return (2.0 / z) * (x / y)
function code(x, y, z, t) return Float64(Float64(2.0 / z) * Float64(x / y)) end
function tmp = code(x, y, z, t) tmp = (2.0 / z) * (x / y); end
code[x_, y_, z_, t_] := N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{z} \cdot \frac{x}{y}
\end{array}
Initial program 87.5%
*-commutative87.5%
distribute-rgt-out--89.9%
times-frac92.8%
Simplified92.8%
Taylor expanded in y around inf 54.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 2023279
(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))))