
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
Initial program 86.0%
associate-/l*97.0%
Simplified97.0%
clear-num96.9%
un-div-inv97.1%
Applied egg-rr97.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.85e+106)
x
(if (<= z -8.2e+82)
(* x (/ (- z) t))
(if (<= z -1.65e+66)
x
(if (<= z -6.4)
(/ (* x (- y)) z)
(if (<= z 5.2e-21) (/ x (/ t y)) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.85e+106) {
tmp = x;
} else if (z <= -8.2e+82) {
tmp = x * (-z / t);
} else if (z <= -1.65e+66) {
tmp = x;
} else if (z <= -6.4) {
tmp = (x * -y) / z;
} else if (z <= 5.2e-21) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.85d+106)) then
tmp = x
else if (z <= (-8.2d+82)) then
tmp = x * (-z / t)
else if (z <= (-1.65d+66)) then
tmp = x
else if (z <= (-6.4d0)) then
tmp = (x * -y) / z
else if (z <= 5.2d-21) then
tmp = x / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.85e+106) {
tmp = x;
} else if (z <= -8.2e+82) {
tmp = x * (-z / t);
} else if (z <= -1.65e+66) {
tmp = x;
} else if (z <= -6.4) {
tmp = (x * -y) / z;
} else if (z <= 5.2e-21) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.85e+106: tmp = x elif z <= -8.2e+82: tmp = x * (-z / t) elif z <= -1.65e+66: tmp = x elif z <= -6.4: tmp = (x * -y) / z elif z <= 5.2e-21: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.85e+106) tmp = x; elseif (z <= -8.2e+82) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -1.65e+66) tmp = x; elseif (z <= -6.4) tmp = Float64(Float64(x * Float64(-y)) / z); elseif (z <= 5.2e-21) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.85e+106) tmp = x; elseif (z <= -8.2e+82) tmp = x * (-z / t); elseif (z <= -1.65e+66) tmp = x; elseif (z <= -6.4) tmp = (x * -y) / z; elseif (z <= 5.2e-21) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.85e+106], x, If[LessEqual[z, -8.2e+82], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.65e+66], x, If[LessEqual[z, -6.4], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.2e-21], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{+66}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -6.4:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.8499999999999999e106 or -8.1999999999999999e82 < z < -1.6500000000000001e66 or 5.20000000000000035e-21 < z Initial program 77.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 65.2%
if -2.8499999999999999e106 < z < -8.1999999999999999e82Initial program 85.5%
remove-double-neg85.5%
distribute-lft-neg-out85.5%
distribute-neg-frac85.5%
distribute-neg-frac285.5%
distribute-lft-neg-out85.5%
distribute-rgt-neg-in85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
Simplified85.5%
Taylor expanded in y around 0 58.9%
Taylor expanded in z around 0 58.9%
associate-*r/58.9%
mul-1-neg58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
associate-*r/62.2%
neg-mul-162.2%
associate-*r/62.2%
mul-1-neg62.2%
distribute-neg-frac262.2%
Simplified62.2%
Taylor expanded in z around 0 58.9%
mul-1-neg58.9%
associate-/l*72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if -1.6500000000000001e66 < z < -6.4000000000000004Initial program 100.0%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around 0 83.2%
mul-1-neg83.2%
associate-/l*82.8%
distribute-rgt-neg-in82.8%
distribute-frac-neg82.8%
neg-sub082.8%
associate--r-82.8%
neg-sub082.8%
+-commutative82.8%
sub-neg82.8%
div-sub82.8%
*-inverses82.8%
Simplified82.8%
Taylor expanded in y around inf 61.7%
associate-*r/61.7%
associate-*r*61.7%
neg-mul-161.7%
Simplified61.7%
if -6.4000000000000004 < z < 5.20000000000000035e-21Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
clear-num93.6%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 72.0%
Final simplification68.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.6e+106)
x
(if (<= z -3.6e+82)
(* x (/ (- z) t))
(if (<= z -9e+69)
x
(if (<= z -0.0102)
(* y (/ x (- z)))
(if (<= z 4.4e-17) (/ x (/ t y)) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+106) {
tmp = x;
} else if (z <= -3.6e+82) {
tmp = x * (-z / t);
} else if (z <= -9e+69) {
tmp = x;
} else if (z <= -0.0102) {
tmp = y * (x / -z);
} else if (z <= 4.4e-17) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.6d+106)) then
tmp = x
else if (z <= (-3.6d+82)) then
tmp = x * (-z / t)
else if (z <= (-9d+69)) then
tmp = x
else if (z <= (-0.0102d0)) then
tmp = y * (x / -z)
else if (z <= 4.4d-17) then
tmp = x / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+106) {
tmp = x;
} else if (z <= -3.6e+82) {
tmp = x * (-z / t);
} else if (z <= -9e+69) {
tmp = x;
} else if (z <= -0.0102) {
tmp = y * (x / -z);
} else if (z <= 4.4e-17) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e+106: tmp = x elif z <= -3.6e+82: tmp = x * (-z / t) elif z <= -9e+69: tmp = x elif z <= -0.0102: tmp = y * (x / -z) elif z <= 4.4e-17: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e+106) tmp = x; elseif (z <= -3.6e+82) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -9e+69) tmp = x; elseif (z <= -0.0102) tmp = Float64(y * Float64(x / Float64(-z))); elseif (z <= 4.4e-17) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e+106) tmp = x; elseif (z <= -3.6e+82) tmp = x * (-z / t); elseif (z <= -9e+69) tmp = x; elseif (z <= -0.0102) tmp = y * (x / -z); elseif (z <= 4.4e-17) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+106], x, If[LessEqual[z, -3.6e+82], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e+69], x, If[LessEqual[z, -0.0102], N[(y * N[(x / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-17], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -0.0102:\\
\;\;\;\;y \cdot \frac{x}{-z}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5999999999999999e106 or -3.60000000000000014e82 < z < -8.9999999999999999e69 or 4.4e-17 < z Initial program 77.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 65.2%
if -1.5999999999999999e106 < z < -3.60000000000000014e82Initial program 85.5%
remove-double-neg85.5%
distribute-lft-neg-out85.5%
distribute-neg-frac85.5%
distribute-neg-frac285.5%
distribute-lft-neg-out85.5%
distribute-rgt-neg-in85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
Simplified85.5%
Taylor expanded in y around 0 58.9%
Taylor expanded in z around 0 58.9%
associate-*r/58.9%
mul-1-neg58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
associate-*r/62.2%
neg-mul-162.2%
associate-*r/62.2%
mul-1-neg62.2%
distribute-neg-frac262.2%
Simplified62.2%
Taylor expanded in z around 0 58.9%
mul-1-neg58.9%
associate-/l*72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if -8.9999999999999999e69 < z < -0.010200000000000001Initial program 100.0%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around 0 83.2%
mul-1-neg83.2%
associate-/l*82.8%
distribute-rgt-neg-in82.8%
distribute-frac-neg82.8%
neg-sub082.8%
associate--r-82.8%
neg-sub082.8%
+-commutative82.8%
sub-neg82.8%
div-sub82.8%
*-inverses82.8%
Simplified82.8%
Taylor expanded in y around inf 61.7%
associate-*r/61.7%
associate-*r*61.7%
neg-mul-161.7%
Simplified61.7%
associate-/l*61.4%
add-sqr-sqrt29.3%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod0.8%
add-sqr-sqrt1.7%
associate-/l*1.7%
frac-2neg1.7%
distribute-lft-neg-out1.7%
*-commutative1.7%
associate-/l*1.7%
add-sqr-sqrt1.0%
sqrt-unprod25.5%
sqr-neg25.5%
sqrt-unprod32.3%
add-sqr-sqrt61.6%
Applied egg-rr61.6%
if -0.010200000000000001 < z < 4.4e-17Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
clear-num93.6%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 72.0%
Final simplification68.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.76e+106)
x
(if (<= z -5.5e+83)
(* x (/ (- z) t))
(if (<= z -5.9e+68)
x
(if (<= z -2.4)
(* x (/ y (- z)))
(if (<= z 4.5e-18) (/ x (/ t y)) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.76e+106) {
tmp = x;
} else if (z <= -5.5e+83) {
tmp = x * (-z / t);
} else if (z <= -5.9e+68) {
tmp = x;
} else if (z <= -2.4) {
tmp = x * (y / -z);
} else if (z <= 4.5e-18) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.76d+106)) then
tmp = x
else if (z <= (-5.5d+83)) then
tmp = x * (-z / t)
else if (z <= (-5.9d+68)) then
tmp = x
else if (z <= (-2.4d0)) then
tmp = x * (y / -z)
else if (z <= 4.5d-18) then
tmp = x / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.76e+106) {
tmp = x;
} else if (z <= -5.5e+83) {
tmp = x * (-z / t);
} else if (z <= -5.9e+68) {
tmp = x;
} else if (z <= -2.4) {
tmp = x * (y / -z);
} else if (z <= 4.5e-18) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.76e+106: tmp = x elif z <= -5.5e+83: tmp = x * (-z / t) elif z <= -5.9e+68: tmp = x elif z <= -2.4: tmp = x * (y / -z) elif z <= 4.5e-18: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.76e+106) tmp = x; elseif (z <= -5.5e+83) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -5.9e+68) tmp = x; elseif (z <= -2.4) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= 4.5e-18) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.76e+106) tmp = x; elseif (z <= -5.5e+83) tmp = x * (-z / t); elseif (z <= -5.9e+68) tmp = x; elseif (z <= -2.4) tmp = x * (y / -z); elseif (z <= 4.5e-18) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.76e+106], x, If[LessEqual[z, -5.5e+83], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.9e+68], x, If[LessEqual[z, -2.4], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-18], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.76 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+83}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -5.9 \cdot 10^{+68}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.4:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.76000000000000005e106 or -5.4999999999999996e83 < z < -5.89999999999999985e68 or 4.49999999999999994e-18 < z Initial program 77.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 65.2%
if -1.76000000000000005e106 < z < -5.4999999999999996e83Initial program 85.5%
remove-double-neg85.5%
distribute-lft-neg-out85.5%
distribute-neg-frac85.5%
distribute-neg-frac285.5%
distribute-lft-neg-out85.5%
distribute-rgt-neg-in85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
Simplified85.5%
Taylor expanded in y around 0 58.9%
Taylor expanded in z around 0 58.9%
associate-*r/58.9%
mul-1-neg58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
associate-*r/62.2%
neg-mul-162.2%
associate-*r/62.2%
mul-1-neg62.2%
distribute-neg-frac262.2%
Simplified62.2%
Taylor expanded in z around 0 58.9%
mul-1-neg58.9%
associate-/l*72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if -5.89999999999999985e68 < z < -2.39999999999999991Initial program 100.0%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around 0 83.2%
mul-1-neg83.2%
associate-/l*82.8%
distribute-rgt-neg-in82.8%
distribute-frac-neg82.8%
neg-sub082.8%
associate--r-82.8%
neg-sub082.8%
+-commutative82.8%
sub-neg82.8%
div-sub82.8%
*-inverses82.8%
Simplified82.8%
Taylor expanded in y around inf 61.7%
associate-*r/61.7%
mul-1-neg61.7%
distribute-rgt-neg-in61.7%
associate-*r/61.4%
Simplified61.4%
if -2.39999999999999991 < z < 4.49999999999999994e-18Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
clear-num93.6%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 72.0%
Final simplification68.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.6e+106)
x
(if (<= z -7.4e+83)
(* x (/ (- z) t))
(if (<= z -10500.0) x (if (<= z 2.5e-17) (/ x (/ t y)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+106) {
tmp = x;
} else if (z <= -7.4e+83) {
tmp = x * (-z / t);
} else if (z <= -10500.0) {
tmp = x;
} else if (z <= 2.5e-17) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.6d+106)) then
tmp = x
else if (z <= (-7.4d+83)) then
tmp = x * (-z / t)
else if (z <= (-10500.0d0)) then
tmp = x
else if (z <= 2.5d-17) then
tmp = x / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+106) {
tmp = x;
} else if (z <= -7.4e+83) {
tmp = x * (-z / t);
} else if (z <= -10500.0) {
tmp = x;
} else if (z <= 2.5e-17) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e+106: tmp = x elif z <= -7.4e+83: tmp = x * (-z / t) elif z <= -10500.0: tmp = x elif z <= 2.5e-17: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e+106) tmp = x; elseif (z <= -7.4e+83) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -10500.0) tmp = x; elseif (z <= 2.5e-17) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e+106) tmp = x; elseif (z <= -7.4e+83) tmp = x * (-z / t); elseif (z <= -10500.0) tmp = x; elseif (z <= 2.5e-17) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+106], x, If[LessEqual[z, -7.4e+83], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -10500.0], x, If[LessEqual[z, 2.5e-17], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{+83}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -10500:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5999999999999999e106 or -7.4000000000000005e83 < z < -10500 or 2.4999999999999999e-17 < z Initial program 79.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.9%
if -1.5999999999999999e106 < z < -7.4000000000000005e83Initial program 85.5%
remove-double-neg85.5%
distribute-lft-neg-out85.5%
distribute-neg-frac85.5%
distribute-neg-frac285.5%
distribute-lft-neg-out85.5%
distribute-rgt-neg-in85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
sub-neg85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
+-commutative85.5%
sub-neg85.5%
Simplified85.5%
Taylor expanded in y around 0 58.9%
Taylor expanded in z around 0 58.9%
associate-*r/58.9%
mul-1-neg58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
associate-*r/62.2%
neg-mul-162.2%
associate-*r/62.2%
mul-1-neg62.2%
distribute-neg-frac262.2%
Simplified62.2%
Taylor expanded in z around 0 58.9%
mul-1-neg58.9%
associate-/l*72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if -10500 < z < 2.4999999999999999e-17Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
clear-num93.6%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 72.0%
Final simplification66.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e+27) (not (<= y 2e-5))) (/ x (/ (- t z) y)) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+27) || !(y <= 2e-5)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4d+27)) .or. (.not. (y <= 2d-5))) then
tmp = x / ((t - z) / y)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+27) || !(y <= 2e-5)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4e+27) or not (y <= 2e-5): tmp = x / ((t - z) / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4e+27) || !(y <= 2e-5)) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4e+27) || ~((y <= 2e-5))) tmp = x / ((t - z) / y); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4e+27], N[Not[LessEqual[y, 2e-5]], $MachinePrecision]], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+27} \lor \neg \left(y \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -4.0000000000000001e27 or 2.00000000000000016e-5 < y Initial program 86.5%
associate-/l*96.6%
Simplified96.6%
clear-num96.5%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in y around inf 78.2%
if -4.0000000000000001e27 < y < 2.00000000000000016e-5Initial program 85.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around 0 70.7%
mul-1-neg70.7%
distribute-neg-frac270.7%
neg-sub070.7%
associate--r-70.7%
neg-sub070.7%
+-commutative70.7%
sub-neg70.7%
associate-/l*84.1%
Simplified84.1%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -400.0) (not (<= z 1.3e-18))) (* x (- 1.0 (/ y z))) (/ x (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -400.0) || !(z <= 1.3e-18)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-400.0d0)) .or. (.not. (z <= 1.3d-18))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -400.0) || !(z <= 1.3e-18)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -400.0) or not (z <= 1.3e-18): tmp = x * (1.0 - (y / z)) else: tmp = x / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -400.0) || !(z <= 1.3e-18)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -400.0) || ~((z <= 1.3e-18))) tmp = x * (1.0 - (y / z)); else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -400.0], N[Not[LessEqual[z, 1.3e-18]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -400 \lor \neg \left(z \leq 1.3 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -400 or 1.3e-18 < z Initial program 79.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 62.3%
mul-1-neg62.3%
associate-/l*77.3%
distribute-rgt-neg-in77.3%
distribute-frac-neg77.3%
neg-sub077.3%
associate--r-77.3%
neg-sub077.3%
+-commutative77.3%
sub-neg77.3%
div-sub77.3%
*-inverses77.3%
Simplified77.3%
if -400 < z < 1.3e-18Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
clear-num93.6%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 72.0%
Final simplification74.8%
(FPCore (x y z t) :precision binary64 (if (<= z -0.0042) (* x (- 1.0 (/ y z))) (if (<= z 6.6e-51) (/ x (/ t y)) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0042) {
tmp = x * (1.0 - (y / z));
} else if (z <= 6.6e-51) {
tmp = x / (t / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-0.0042d0)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 6.6d-51) then
tmp = x / (t / y)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0042) {
tmp = x * (1.0 - (y / z));
} else if (z <= 6.6e-51) {
tmp = x / (t / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.0042: tmp = x * (1.0 - (y / z)) elif z <= 6.6e-51: tmp = x / (t / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.0042) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 6.6e-51) tmp = Float64(x / Float64(t / y)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.0042) tmp = x * (1.0 - (y / z)); elseif (z <= 6.6e-51) tmp = x / (t / y); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.0042], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-51], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0042:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -0.00419999999999999974Initial program 80.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 61.0%
mul-1-neg61.0%
associate-/l*75.2%
distribute-rgt-neg-in75.2%
distribute-frac-neg75.2%
neg-sub075.2%
associate--r-75.2%
neg-sub075.2%
+-commutative75.2%
sub-neg75.2%
div-sub75.2%
*-inverses75.2%
Simplified75.2%
if -0.00419999999999999974 < z < 6.59999999999999946e-51Initial program 92.4%
associate-/l*93.6%
Simplified93.6%
clear-num93.2%
un-div-inv93.6%
Applied egg-rr93.6%
Taylor expanded in z around 0 73.7%
if 6.59999999999999946e-51 < z Initial program 81.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 64.1%
mul-1-neg64.1%
distribute-neg-frac264.1%
neg-sub064.1%
associate--r-64.1%
neg-sub064.1%
+-commutative64.1%
sub-neg64.1%
associate-/l*81.2%
Simplified81.2%
(FPCore (x y z t) :precision binary64 (if (<= z -0.54) x (if (<= z 4.4e-17) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.54) {
tmp = x;
} else if (z <= 4.4e-17) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-0.54d0)) then
tmp = x
else if (z <= 4.4d-17) then
tmp = x / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.54) {
tmp = x;
} else if (z <= 4.4e-17) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.54: tmp = x elif z <= 4.4e-17: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.54) tmp = x; elseif (z <= 4.4e-17) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.54) tmp = x; elseif (z <= 4.4e-17) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.54], x, If[LessEqual[z, 4.4e-17], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.54:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.54000000000000004 or 4.4e-17 < z Initial program 79.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 58.1%
if -0.54000000000000004 < z < 4.4e-17Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
clear-num93.6%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 72.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1200.0) x (if (<= z 4.5e-18) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1200.0) {
tmp = x;
} else if (z <= 4.5e-18) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1200.0d0)) then
tmp = x
else if (z <= 4.5d-18) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1200.0) {
tmp = x;
} else if (z <= 4.5e-18) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1200.0: tmp = x elif z <= 4.5e-18: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1200.0) tmp = x; elseif (z <= 4.5e-18) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1200.0) tmp = x; elseif (z <= 4.5e-18) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1200.0], x, If[LessEqual[z, 4.5e-18], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1200:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1200 or 4.49999999999999994e-18 < z Initial program 79.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 58.1%
if -1200 < z < 4.49999999999999994e-18Initial program 92.9%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around 0 70.2%
associate-/l*71.8%
Simplified71.8%
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y - z) / (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
def code(x, y, z, t): return x * ((y - z) / (t - z))
function code(x, y, z, t) return Float64(x * Float64(Float64(y - z) / Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x * ((y - z) / (t - z)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 86.0%
associate-/l*97.0%
Simplified97.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 86.0%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 35.6%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024100
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))