
(FPCore (x y z) :precision binary64 :pre TRUE (/ (* x (/ (sin y) y)) z))
double code(double x, double y, double z) {
return (x * (sin(y) / y)) / z;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (sin(y) / y)) / z
end function
public static double code(double x, double y, double z) {
return (x * (Math.sin(y) / y)) / z;
}
def code(x, y, z): return (x * (math.sin(y) / y)) / z
function code(x, y, z) return Float64(Float64(x * Float64(sin(y) / y)) / z) end
function tmp = code(x, y, z) tmp = (x * (sin(y) / y)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
f(x, y, z): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf] code: THEORY BEGIN f(x, y, z: real): real = (x * ((sin(y)) / y)) / z END code
\frac{x \cdot \frac{\sin y}{y}}{z}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 :pre TRUE (/ (* x (/ (sin y) y)) z))
double code(double x, double y, double z) {
return (x * (sin(y) / y)) / z;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (sin(y) / y)) / z
end function
public static double code(double x, double y, double z) {
return (x * (Math.sin(y) / y)) / z;
}
def code(x, y, z): return (x * (math.sin(y) / y)) / z
function code(x, y, z) return Float64(Float64(x * Float64(sin(y) / y)) / z) end
function tmp = code(x, y, z) tmp = (x * (sin(y) / y)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
f(x, y, z): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf] code: THEORY BEGIN f(x, y, z: real): real = (x * ((sin(y)) / y)) / z END code
\frac{x \cdot \frac{\sin y}{y}}{z}
(FPCore (x y z)
:precision binary64
:pre TRUE
(let* ((t_0 (/ (sin y) y)))
(*
(copysign 1.0 x)
(if (<= (fabs x) 2.0043961067331517e-110)
(* (/ (fabs x) z) t_0)
(/ (* (fabs x) t_0) z)))))double code(double x, double y, double z) {
double t_0 = sin(y) / y;
double tmp;
if (fabs(x) <= 2.0043961067331517e-110) {
tmp = (fabs(x) / z) * t_0;
} else {
tmp = (fabs(x) * t_0) / z;
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.sin(y) / y;
double tmp;
if (Math.abs(x) <= 2.0043961067331517e-110) {
tmp = (Math.abs(x) / z) * t_0;
} else {
tmp = (Math.abs(x) * t_0) / z;
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z): t_0 = math.sin(y) / y tmp = 0 if math.fabs(x) <= 2.0043961067331517e-110: tmp = (math.fabs(x) / z) * t_0 else: tmp = (math.fabs(x) * t_0) / z return math.copysign(1.0, x) * tmp
function code(x, y, z) t_0 = Float64(sin(y) / y) tmp = 0.0 if (abs(x) <= 2.0043961067331517e-110) tmp = Float64(Float64(abs(x) / z) * t_0); else tmp = Float64(Float64(abs(x) * t_0) / z); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z) t_0 = sin(y) / y; tmp = 0.0; if (abs(x) <= 2.0043961067331517e-110) tmp = (abs(x) / z) * t_0; else tmp = (abs(x) * t_0) / z; end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[x], $MachinePrecision], 2.0043961067331517e-110], N[(N[(N[Abs[x], $MachinePrecision] / z), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] * t$95$0), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 2.0043961067331517 \cdot 10^{-110}:\\
\;\;\;\;\frac{\left|x\right|}{z} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right| \cdot t\_0}{z}\\
\end{array}
\end{array}
if x < 2.0043961067331517e-110Initial program 96.4%
Applied rewrites96.0%
if 2.0043961067331517e-110 < x Initial program 96.4%
(FPCore (x y z) :precision binary64 :pre TRUE (* (copysign 1.0 x) (if (<= (fabs x) 2.0273008920664322e+40) (* (/ (fabs x) z) (/ (sin y) y)) (/ (/ (* (fabs x) (sin y)) y) z))))
double code(double x, double y, double z) {
double tmp;
if (fabs(x) <= 2.0273008920664322e+40) {
tmp = (fabs(x) / z) * (sin(y) / y);
} else {
tmp = ((fabs(x) * sin(y)) / y) / z;
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if (Math.abs(x) <= 2.0273008920664322e+40) {
tmp = (Math.abs(x) / z) * (Math.sin(y) / y);
} else {
tmp = ((Math.abs(x) * Math.sin(y)) / y) / z;
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z): tmp = 0 if math.fabs(x) <= 2.0273008920664322e+40: tmp = (math.fabs(x) / z) * (math.sin(y) / y) else: tmp = ((math.fabs(x) * math.sin(y)) / y) / z return math.copysign(1.0, x) * tmp
function code(x, y, z) tmp = 0.0 if (abs(x) <= 2.0273008920664322e+40) tmp = Float64(Float64(abs(x) / z) * Float64(sin(y) / y)); else tmp = Float64(Float64(Float64(abs(x) * sin(y)) / y) / z); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z) tmp = 0.0; if (abs(x) <= 2.0273008920664322e+40) tmp = (abs(x) / z) * (sin(y) / y); else tmp = ((abs(x) * sin(y)) / y) / z; end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[x], $MachinePrecision], 2.0273008920664322e+40], N[(N[(N[Abs[x], $MachinePrecision] / z), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Abs[x], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 2.0273008920664322 \cdot 10^{+40}:\\
\;\;\;\;\frac{\left|x\right|}{z} \cdot \frac{\sin y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|x\right| \cdot \sin y}{y}}{z}\\
\end{array}
if x < 2.0273008920664322e40Initial program 96.4%
Applied rewrites96.0%
if 2.0273008920664322e40 < x Initial program 96.4%
Taylor expanded in x around 0
Applied rewrites88.7%
(FPCore (x y z)
:precision binary64
:pre TRUE
(let* ((t_0 (/ (sin y) y)))
(*
(copysign 1.0 z)
(if (<= (fabs z) 2.2705743560222577e-89)
(* x (/ t_0 (fabs z)))
(* (/ x (fabs z)) t_0)))))double code(double x, double y, double z) {
double t_0 = sin(y) / y;
double tmp;
if (fabs(z) <= 2.2705743560222577e-89) {
tmp = x * (t_0 / fabs(z));
} else {
tmp = (x / fabs(z)) * t_0;
}
return copysign(1.0, z) * tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.sin(y) / y;
double tmp;
if (Math.abs(z) <= 2.2705743560222577e-89) {
tmp = x * (t_0 / Math.abs(z));
} else {
tmp = (x / Math.abs(z)) * t_0;
}
return Math.copySign(1.0, z) * tmp;
}
def code(x, y, z): t_0 = math.sin(y) / y tmp = 0 if math.fabs(z) <= 2.2705743560222577e-89: tmp = x * (t_0 / math.fabs(z)) else: tmp = (x / math.fabs(z)) * t_0 return math.copysign(1.0, z) * tmp
function code(x, y, z) t_0 = Float64(sin(y) / y) tmp = 0.0 if (abs(z) <= 2.2705743560222577e-89) tmp = Float64(x * Float64(t_0 / abs(z))); else tmp = Float64(Float64(x / abs(z)) * t_0); end return Float64(copysign(1.0, z) * tmp) end
function tmp_2 = code(x, y, z) t_0 = sin(y) / y; tmp = 0.0; if (abs(z) <= 2.2705743560222577e-89) tmp = x * (t_0 / abs(z)); else tmp = (x / abs(z)) * t_0; end tmp_2 = (sign(z) * abs(1.0)) * tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[z], $MachinePrecision], 2.2705743560222577e-89], N[(x * N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[Abs[z], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|z\right| \leq 2.2705743560222577 \cdot 10^{-89}:\\
\;\;\;\;x \cdot \frac{t\_0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left|z\right|} \cdot t\_0\\
\end{array}
\end{array}
if z < 2.2705743560222577e-89Initial program 96.4%
Applied rewrites88.3%
Applied rewrites96.2%
if 2.2705743560222577e-89 < z Initial program 96.4%
Applied rewrites96.0%
(FPCore (x y z) :precision binary64 :pre TRUE (* x (/ (/ (sin y) y) z)))
double code(double x, double y, double z) {
return x * ((sin(y) / y) / z);
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * ((sin(y) / y) / z)
end function
public static double code(double x, double y, double z) {
return x * ((Math.sin(y) / y) / z);
}
def code(x, y, z): return x * ((math.sin(y) / y) / z)
function code(x, y, z) return Float64(x * Float64(Float64(sin(y) / y) / z)) end
function tmp = code(x, y, z) tmp = x * ((sin(y) / y) / z); end
code[x_, y_, z_] := N[(x * N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
f(x, y, z): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf] code: THEORY BEGIN f(x, y, z: real): real = x * (((sin(y)) / y) / z) END code
x \cdot \frac{\frac{\sin y}{y}}{z}
Initial program 96.4%
Applied rewrites88.3%
Applied rewrites96.2%
(FPCore (x y z) :precision binary64 :pre TRUE (if (<= (/ (sin y) y) 0.999998) (* x (/ (sin y) (* z y))) (/ (* x (+ 1.0 (* -0.16666666666666666 (pow y 2.0)))) z)))
double code(double x, double y, double z) {
double tmp;
if ((sin(y) / y) <= 0.999998) {
tmp = x * (sin(y) / (z * y));
} else {
tmp = (x * (1.0 + (-0.16666666666666666 * pow(y, 2.0)))) / z;
}
return tmp;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((sin(y) / y) <= 0.999998d0) then
tmp = x * (sin(y) / (z * y))
else
tmp = (x * (1.0d0 + ((-0.16666666666666666d0) * (y ** 2.0d0)))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((Math.sin(y) / y) <= 0.999998) {
tmp = x * (Math.sin(y) / (z * y));
} else {
tmp = (x * (1.0 + (-0.16666666666666666 * Math.pow(y, 2.0)))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (math.sin(y) / y) <= 0.999998: tmp = x * (math.sin(y) / (z * y)) else: tmp = (x * (1.0 + (-0.16666666666666666 * math.pow(y, 2.0)))) / z return tmp
function code(x, y, z) tmp = 0.0 if (Float64(sin(y) / y) <= 0.999998) tmp = Float64(x * Float64(sin(y) / Float64(z * y))); else tmp = Float64(Float64(x * Float64(1.0 + Float64(-0.16666666666666666 * (y ^ 2.0)))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((sin(y) / y) <= 0.999998) tmp = x * (sin(y) / (z * y)); else tmp = (x * (1.0 + (-0.16666666666666666 * (y ^ 2.0)))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], 0.999998], N[(x * N[(N[Sin[y], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 + N[(-0.16666666666666666 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
f(x, y, z): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf] code: THEORY BEGIN f(x, y, z: real): real = LET tmp = IF (((sin(y)) / y) <= (99999800000000005351097343009314499795436859130859375e-53)) THEN (x * ((sin(y)) / (z * y))) ELSE ((x * ((1) + ((-1666666666666666574148081281236954964697360992431640625e-55) * (y ^ (2))))) / z) ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;\frac{\sin y}{y} \leq 0.999998:\\
\;\;\;\;x \cdot \frac{\sin y}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(1 + -0.16666666666666666 \cdot {y}^{2}\right)}{z}\\
\end{array}
if (/.f64 (sin.f64 y) y) < 0.99999800000000005Initial program 96.4%
Applied rewrites88.3%
if 0.99999800000000005 < (/.f64 (sin.f64 y) y) Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites53.3%
(FPCore (x y z) :precision binary64 :pre TRUE (if (<= (fabs y) 0.00023416457863042044) (/ (* x (+ 1.0 (* -0.16666666666666666 (pow (fabs y) 2.0)))) z) (/ (* x (sin (fabs y))) (* (fabs y) z))))
double code(double x, double y, double z) {
double tmp;
if (fabs(y) <= 0.00023416457863042044) {
tmp = (x * (1.0 + (-0.16666666666666666 * pow(fabs(y), 2.0)))) / z;
} else {
tmp = (x * sin(fabs(y))) / (fabs(y) * z);
}
return tmp;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (abs(y) <= 0.00023416457863042044d0) then
tmp = (x * (1.0d0 + ((-0.16666666666666666d0) * (abs(y) ** 2.0d0)))) / z
else
tmp = (x * sin(abs(y))) / (abs(y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (Math.abs(y) <= 0.00023416457863042044) {
tmp = (x * (1.0 + (-0.16666666666666666 * Math.pow(Math.abs(y), 2.0)))) / z;
} else {
tmp = (x * Math.sin(Math.abs(y))) / (Math.abs(y) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.fabs(y) <= 0.00023416457863042044: tmp = (x * (1.0 + (-0.16666666666666666 * math.pow(math.fabs(y), 2.0)))) / z else: tmp = (x * math.sin(math.fabs(y))) / (math.fabs(y) * z) return tmp
function code(x, y, z) tmp = 0.0 if (abs(y) <= 0.00023416457863042044) tmp = Float64(Float64(x * Float64(1.0 + Float64(-0.16666666666666666 * (abs(y) ^ 2.0)))) / z); else tmp = Float64(Float64(x * sin(abs(y))) / Float64(abs(y) * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (abs(y) <= 0.00023416457863042044) tmp = (x * (1.0 + (-0.16666666666666666 * (abs(y) ^ 2.0)))) / z; else tmp = (x * sin(abs(y))) / (abs(y) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Abs[y], $MachinePrecision], 0.00023416457863042044], N[(N[(x * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[Sin[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[Abs[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
f(x, y, z): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf] code: THEORY BEGIN f(x, y, z: real): real = LET tmp = IF ((abs(y)) <= (23416457863042043651725931940887903692782856523990631103515625e-65)) THEN ((x * ((1) + ((-1666666666666666574148081281236954964697360992431640625e-55) * ((abs(y)) ^ (2))))) / z) ELSE ((x * (sin((abs(y))))) / ((abs(y)) * z)) ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;\left|y\right| \leq 0.00023416457863042044:\\
\;\;\;\;\frac{x \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|y\right|\right)}^{2}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \sin \left(\left|y\right|\right)}{\left|y\right| \cdot z}\\
\end{array}
if y < 2.3416457863042044e-4Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites53.3%
if 2.3416457863042044e-4 < y Initial program 96.4%
Taylor expanded in x around 0
Applied rewrites84.3%
(FPCore (x y z)
:precision binary64
:pre TRUE
(let* ((t_0 (/ (fabs x) (fabs z)))
(t_1 (/ (* (fabs x) (/ (sin y) y)) (fabs z))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 z)
(if (<= t_1 -1e-96)
(* (fma (* y y) -0.16666666666666666 1.0) t_0)
(if (<= t_1 5e-319) (/ 0.0 (fabs z)) t_0))))))double code(double x, double y, double z) {
double t_0 = fabs(x) / fabs(z);
double t_1 = (fabs(x) * (sin(y) / y)) / fabs(z);
double tmp;
if (t_1 <= -1e-96) {
tmp = fma((y * y), -0.16666666666666666, 1.0) * t_0;
} else if (t_1 <= 5e-319) {
tmp = 0.0 / fabs(z);
} else {
tmp = t_0;
}
return copysign(1.0, x) * (copysign(1.0, z) * tmp);
}
function code(x, y, z) t_0 = Float64(abs(x) / abs(z)) t_1 = Float64(Float64(abs(x) * Float64(sin(y) / y)) / abs(z)) tmp = 0.0 if (t_1 <= -1e-96) tmp = Float64(fma(Float64(y * y), -0.16666666666666666, 1.0) * t_0); elseif (t_1 <= 5e-319) tmp = Float64(0.0 / abs(z)); else tmp = t_0; end return Float64(copysign(1.0, x) * Float64(copysign(1.0, z) * tmp)) end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[x], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Abs[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, -1e-96], N[(N[(N[(y * y), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 5e-319], N[(0.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{\left|x\right|}{\left|z\right|}\\
t_1 := \frac{\left|x\right| \cdot \frac{\sin y}{y}}{\left|z\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-96}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\right)
\end{array}
if (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < -9.9999999999999991e-97Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites53.3%
Applied rewrites55.0%
if -9.9999999999999991e-97 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < 4.9999937424779992e-319Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
Taylor expanded in undef-var around zero
Applied rewrites23.6%
if 4.9999937424779992e-319 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
(FPCore (x y z)
:precision binary64
:pre TRUE
(let* ((t_0 (/ (* (fabs x) (/ (sin y) y)) (fabs z))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 z)
(if (<= t_0 -1e-96)
(* (fabs x) (/ (fma (* y y) -0.16666666666666666 1.0) (fabs z)))
(if (<= t_0 5e-319) (/ 0.0 (fabs z)) (/ (fabs x) (fabs z))))))))double code(double x, double y, double z) {
double t_0 = (fabs(x) * (sin(y) / y)) / fabs(z);
double tmp;
if (t_0 <= -1e-96) {
tmp = fabs(x) * (fma((y * y), -0.16666666666666666, 1.0) / fabs(z));
} else if (t_0 <= 5e-319) {
tmp = 0.0 / fabs(z);
} else {
tmp = fabs(x) / fabs(z);
}
return copysign(1.0, x) * (copysign(1.0, z) * tmp);
}
function code(x, y, z) t_0 = Float64(Float64(abs(x) * Float64(sin(y) / y)) / abs(z)) tmp = 0.0 if (t_0 <= -1e-96) tmp = Float64(abs(x) * Float64(fma(Float64(y * y), -0.16666666666666666, 1.0) / abs(z))); elseif (t_0 <= 5e-319) tmp = Float64(0.0 / abs(z)); else tmp = Float64(abs(x) / abs(z)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, z) * tmp)) end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, -1e-96], N[(N[Abs[x], $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-319], N[(0.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\left|x\right| \cdot \frac{\sin y}{y}}{\left|z\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-96}:\\
\;\;\;\;\left|x\right| \cdot \frac{\mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}{\left|z\right|}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{\left|z\right|}\\
\end{array}\right)
\end{array}
if (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < -9.9999999999999991e-97Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites53.3%
Applied rewrites53.2%
if -9.9999999999999991e-97 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < 4.9999937424779992e-319Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
Taylor expanded in undef-var around zero
Applied rewrites23.6%
if 4.9999937424779992e-319 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
(FPCore (x y z)
:precision binary64
:pre TRUE
(*
(copysign 1.0 x)
(*
(copysign 1.0 z)
(if (<= (/ (* (fabs x) (/ (sin y) y)) (fabs z)) 5e-319)
(/ 0.0 (fabs z))
(/ (fabs x) (fabs z))))))double code(double x, double y, double z) {
double tmp;
if (((fabs(x) * (sin(y) / y)) / fabs(z)) <= 5e-319) {
tmp = 0.0 / fabs(z);
} else {
tmp = fabs(x) / fabs(z);
}
return copysign(1.0, x) * (copysign(1.0, z) * tmp);
}
public static double code(double x, double y, double z) {
double tmp;
if (((Math.abs(x) * (Math.sin(y) / y)) / Math.abs(z)) <= 5e-319) {
tmp = 0.0 / Math.abs(z);
} else {
tmp = Math.abs(x) / Math.abs(z);
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, z) * tmp);
}
def code(x, y, z): tmp = 0 if ((math.fabs(x) * (math.sin(y) / y)) / math.fabs(z)) <= 5e-319: tmp = 0.0 / math.fabs(z) else: tmp = math.fabs(x) / math.fabs(z) return math.copysign(1.0, x) * (math.copysign(1.0, z) * tmp)
function code(x, y, z) tmp = 0.0 if (Float64(Float64(abs(x) * Float64(sin(y) / y)) / abs(z)) <= 5e-319) tmp = Float64(0.0 / abs(z)); else tmp = Float64(abs(x) / abs(z)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, z) * tmp)) end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((abs(x) * (sin(y) / y)) / abs(z)) <= 5e-319) tmp = 0.0 / abs(z); else tmp = abs(x) / abs(z); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp); end
code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Abs[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 5e-319], N[(0.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\left|x\right| \cdot \frac{\sin y}{y}}{\left|z\right|} \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{\left|z\right|}\\
\end{array}\right)
if (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < 4.9999937424779992e-319Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
Taylor expanded in undef-var around zero
Applied rewrites23.6%
if 4.9999937424779992e-319 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
(FPCore (x y z) :precision binary64 :pre TRUE (/ x z))
double code(double x, double y, double z) {
return x / z;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x / z
end function
public static double code(double x, double y, double z) {
return x / z;
}
def code(x, y, z): return x / z
function code(x, y, z) return Float64(x / z) end
function tmp = code(x, y, z) tmp = x / z; end
code[x_, y_, z_] := N[(x / z), $MachinePrecision]
f(x, y, z): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf] code: THEORY BEGIN f(x, y, z: real): real = x / z END code
\frac{x}{z}
Initial program 96.4%
Taylor expanded in y around 0
Applied rewrites58.9%
herbie shell --seed 2026092
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
(/ (* x (/ (sin y) y)) z))